danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef CONTENT_BROWSER_RENDERER_HOST_FRAME_TREE_H_ |
| 6 | #define CONTENT_BROWSER_RENDERER_HOST_FRAME_TREE_H_ |
| 7 | |
| 8 | #include <stdint.h> |
| 9 | |
| 10 | #include <iterator> |
| 11 | #include <memory> |
| 12 | #include <string> |
| 13 | #include <unordered_map> |
| 14 | |
| 15 | #include "base/callback.h" |
| 16 | #include "base/containers/queue.h" |
Carlos Caballero | 101ac26b | 2021-03-24 11:54:05 | [diff] [blame] | 17 | #include "base/dcheck_is_on.h" |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 18 | #include "base/gtest_prod_util.h" |
Keishi Hattori | 0e45c02 | 2021-11-27 09:25:52 | [diff] [blame] | 19 | #include "base/memory/raw_ptr.h" |
Dave Tapuska | d8b0530f | 2021-10-19 15:12:31 | [diff] [blame] | 20 | #include "base/memory/safe_ref.h" |
| 21 | #include "base/memory/weak_ptr.h" |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 22 | #include "content/browser/renderer_host/navigator.h" |
| 23 | #include "content/browser/renderer_host/navigator_delegate.h" |
| 24 | #include "content/browser/renderer_host/render_frame_host_manager.h" |
| 25 | #include "content/common/content_export.h" |
| 26 | #include "mojo/public/cpp/bindings/pending_receiver.h" |
| 27 | #include "services/service_manager/public/mojom/interface_provider.mojom.h" |
David Bokan | c3fb5fa | 2022-07-04 14:55:31 | [diff] [blame] | 28 | #include "third_party/blink/public/common/features.h" |
Kevin McNee | 43fe829 | 2021-10-04 22:59:41 | [diff] [blame] | 29 | #include "third_party/blink/public/common/frame/frame_owner_element_type.h" |
Chris Hamilton | 3ff6ed0e | 2021-02-19 03:54:04 | [diff] [blame] | 30 | #include "third_party/blink/public/common/tokens/tokens.h" |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 31 | #include "third_party/blink/public/mojom/frame/frame_owner_properties.mojom-forward.h" |
| 32 | |
| 33 | namespace blink { |
Lei Zhang | 4a86767 | 2021-07-19 06:30:14 | [diff] [blame] | 34 | namespace mojom { |
| 35 | class BrowserInterfaceBroker; |
| 36 | enum class TreeScopeType; |
| 37 | } // namespace mojom |
| 38 | |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 39 | struct FramePolicy; |
| 40 | } // namespace blink |
| 41 | |
| 42 | namespace content { |
| 43 | |
Carlos Caballero | 40b0efd | 2021-01-26 11:55:00 | [diff] [blame] | 44 | class BrowserContext; |
Jeremy Roman | 2d8dfe13 | 2021-07-06 20:51:26 | [diff] [blame] | 45 | class PageDelegate; |
Lei Zhang | 4a86767 | 2021-07-19 06:30:14 | [diff] [blame] | 46 | class PageImpl; |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 47 | class RenderFrameHostDelegate; |
| 48 | class RenderViewHostDelegate; |
| 49 | class RenderViewHostImpl; |
| 50 | class RenderFrameHostManager; |
| 51 | class RenderWidgetHostDelegate; |
Carlos Caballero | 40b0efd | 2021-01-26 11:55:00 | [diff] [blame] | 52 | class SiteInstance; |
Sharon Yang | 57bde12 | 2022-03-01 20:01:12 | [diff] [blame] | 53 | class SiteInstanceGroup; |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 54 | |
| 55 | // Represents the frame tree for a page. With the exception of the main frame, |
| 56 | // all FrameTreeNodes will be created/deleted in response to frame attach and |
| 57 | // detach events in the DOM. |
| 58 | // |
| 59 | // The main frame's FrameTreeNode is special in that it is reused. This allows |
| 60 | // it to serve as an anchor for state that needs to persist across top-level |
| 61 | // page navigations. |
| 62 | // |
| 63 | // TODO(ajwong): Move NavigationController ownership to the main frame |
| 64 | // FrameTreeNode. Possibly expose access to it from here. |
| 65 | // |
| 66 | // This object is only used on the UI thread. |
| 67 | class CONTENT_EXPORT FrameTree { |
| 68 | public: |
| 69 | class NodeRange; |
| 70 | |
Alan Zhao | 8a882d1 | 2022-05-18 01:32:15 | [diff] [blame] | 71 | class CONTENT_EXPORT NodeIterator { |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 72 | public: |
Alan Zhao | 8a882d1 | 2022-05-18 01:32:15 | [diff] [blame] | 73 | using iterator_category = std::forward_iterator_tag; |
| 74 | using value_type = FrameTreeNode*; |
| 75 | using difference_type = std::ptrdiff_t; |
| 76 | using pointer = FrameTreeNode**; |
| 77 | using reference = FrameTreeNode*&; |
| 78 | |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 79 | NodeIterator(const NodeIterator& other); |
| 80 | ~NodeIterator(); |
| 81 | |
| 82 | NodeIterator& operator++(); |
Kevin McNee | 5f59438 | 2021-05-06 23:18:23 | [diff] [blame] | 83 | // Advances the iterator and excludes the children of the current node |
| 84 | NodeIterator& AdvanceSkippingChildren(); |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 85 | |
| 86 | bool operator==(const NodeIterator& rhs) const; |
| 87 | bool operator!=(const NodeIterator& rhs) const { return !(*this == rhs); } |
| 88 | |
| 89 | FrameTreeNode* operator*() { return current_node_; } |
| 90 | |
| 91 | private: |
Jayson Adams | 4db0bfe2 | 2021-07-15 19:24:07 | [diff] [blame] | 92 | friend class FrameTreeTest; |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 93 | friend class NodeRange; |
| 94 | |
Kevin McNee | 5f59438 | 2021-05-06 23:18:23 | [diff] [blame] | 95 | NodeIterator(const std::vector<FrameTreeNode*>& starting_nodes, |
| 96 | const FrameTreeNode* root_of_subtree_to_skip, |
| 97 | bool should_descend_into_inner_trees); |
| 98 | |
| 99 | void AdvanceNode(); |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 100 | |
Lukasz Anforowicz | 877e622 | 2021-11-26 00:03:23 | [diff] [blame] | 101 | // `current_node_` and `root_of_subtree_to_skip_` are not a raw_ptr<...> for |
| 102 | // performance reasons (based on analysis of sampling profiler data and |
| 103 | // tab_search:top100:2020). |
Keishi Hattori | 488b760 | 2022-05-02 13:09:31 | [diff] [blame] | 104 | RAW_PTR_EXCLUSION FrameTreeNode* current_node_; |
| 105 | RAW_PTR_EXCLUSION const FrameTreeNode* const root_of_subtree_to_skip_; |
Lukasz Anforowicz | 877e622 | 2021-11-26 00:03:23 | [diff] [blame] | 106 | |
Kevin McNee | 5f59438 | 2021-05-06 23:18:23 | [diff] [blame] | 107 | const bool should_descend_into_inner_trees_; |
Jayson Adams | 4db0bfe2 | 2021-07-15 19:24:07 | [diff] [blame] | 108 | base::circular_deque<FrameTreeNode*> queue_; |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 109 | }; |
| 110 | |
| 111 | class CONTENT_EXPORT NodeRange { |
| 112 | public: |
Kevin McNee | 5f59438 | 2021-05-06 23:18:23 | [diff] [blame] | 113 | NodeRange(const NodeRange&); |
| 114 | ~NodeRange(); |
| 115 | |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 116 | NodeIterator begin(); |
| 117 | NodeIterator end(); |
| 118 | |
| 119 | private: |
| 120 | friend class FrameTree; |
| 121 | |
Kevin McNee | 5f59438 | 2021-05-06 23:18:23 | [diff] [blame] | 122 | NodeRange(const std::vector<FrameTreeNode*>& starting_nodes, |
| 123 | const FrameTreeNode* root_of_subtree_to_skip, |
| 124 | bool should_descend_into_inner_trees); |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 125 | |
Kevin McNee | 5f59438 | 2021-05-06 23:18:23 | [diff] [blame] | 126 | const std::vector<FrameTreeNode*> starting_nodes_; |
Keishi Hattori | 0e45c02 | 2021-11-27 09:25:52 | [diff] [blame] | 127 | const raw_ptr<const FrameTreeNode> root_of_subtree_to_skip_; |
Kevin McNee | 5f59438 | 2021-05-06 23:18:23 | [diff] [blame] | 128 | const bool should_descend_into_inner_trees_; |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 129 | }; |
| 130 | |
Carlos Caballero | 0326252 | 2021-02-05 14:49:58 | [diff] [blame] | 131 | class CONTENT_EXPORT Delegate { |
| 132 | public: |
| 133 | // A RenderFrameHost in the specified |frame_tree_node| started loading a |
| 134 | // new document. This corresponds to browser UI starting to show a spinner |
| 135 | // or other visual indicator for loading. This method is only invoked if the |
Nate Chapin | 9aabf5f | 2021-11-12 00:31:19 | [diff] [blame] | 136 | // FrameTree hadn't been previously loading. |should_show_loading_ui| will |
| 137 | // be true unless the load is a fragment navigation, or triggered by |
Carlos Caballero | 0326252 | 2021-02-05 14:49:58 | [diff] [blame] | 138 | // history.pushState/replaceState. |
| 139 | virtual void DidStartLoading(FrameTreeNode* frame_tree_node, |
Nate Chapin | 9aabf5f | 2021-11-12 00:31:19 | [diff] [blame] | 140 | bool should_show_loading_ui) = 0; |
Carlos Caballero | 0326252 | 2021-02-05 14:49:58 | [diff] [blame] | 141 | |
Takashi Toyoshima | 74090df6 | 2021-03-09 14:34:57 | [diff] [blame] | 142 | // This is called when all nodes in the FrameTree stopped loading. This |
Carlos Caballero | 0326252 | 2021-02-05 14:49:58 | [diff] [blame] | 143 | // corresponds to the browser UI stop showing a spinner or other visual |
| 144 | // indicator for loading. |
| 145 | virtual void DidStopLoading() = 0; |
| 146 | |
Sreeja Kamishetty | d64b993d | 2022-02-14 12:04:42 | [diff] [blame] | 147 | // Returns the delegate's top loading tree, which should be used to infer |
Yu Gao | c8c1855 | 2022-06-22 14:38:45 | [diff] [blame] | 148 | // the values of loading-related states. The state of |
| 149 | // IsLoadingIncludingInnerFrameTrees() is a WebContents level concept and |
| 150 | // LoadingTree would return the frame tree to which loading events should be |
| 151 | // directed. |
Sreeja Kamishetty | d64b993d | 2022-02-14 12:04:42 | [diff] [blame] | 152 | // |
| 153 | // TODO(crbug.com/1261928): Remove this method and directly rely on |
| 154 | // GetOutermostMainFrame() once portals and guest views are migrated to |
| 155 | // MPArch. |
| 156 | virtual FrameTree* LoadingTree() = 0; |
| 157 | |
Carlos Caballero | 6ff6ace | 2021-02-05 16:53:00 | [diff] [blame] | 158 | // Returns true when the active RenderWidgetHostView should be hidden. |
| 159 | virtual bool IsHidden() = 0; |
Sreeja Kamishetty | a21b4f6 | 2021-06-25 07:48:25 | [diff] [blame] | 160 | |
Sreeja Kamishetty | 5346897 | 2021-07-13 11:53:32 | [diff] [blame] | 161 | // Called when current Page of this frame tree changes to `page`. |
| 162 | virtual void NotifyPageChanged(PageImpl& page) = 0; |
Dominic Farolino | edf44ee | 2021-07-20 23:50:59 | [diff] [blame] | 163 | |
| 164 | // If the FrameTree using this delegate is an inner/nested FrameTree, then |
| 165 | // there may be a FrameTreeNode in the outer FrameTree that is considered |
| 166 | // our outer delegate FrameTreeNode. This method returns the outer delegate |
| 167 | // FrameTreeNode ID if one exists. If we don't have a an outer delegate |
| 168 | // FrameTreeNode, this method returns |
| 169 | // FrameTreeNode::kFrameTreeNodeInvalidId. |
| 170 | virtual int GetOuterDelegateFrameTreeNodeId() = 0; |
Dave Tapuska | c8de3b0 | 2021-12-03 21:51:01 | [diff] [blame] | 171 | |
| 172 | // Returns if this FrameTree represents a portal. |
| 173 | virtual bool IsPortal() = 0; |
Carlos Caballero | 0326252 | 2021-02-05 14:49:58 | [diff] [blame] | 174 | }; |
| 175 | |
Sreeja Kamishetty | 74bacd52 | 2021-03-22 17:04:24 | [diff] [blame] | 176 | // Type of FrameTree instance. |
| 177 | enum class Type { |
| 178 | // This FrameTree is the primary frame tree for the WebContents, whose main |
| 179 | // document URL is shown in the Omnibox. |
| 180 | kPrimary, |
| 181 | |
| 182 | // This FrameTree is used to prerender a page in the background which is |
| 183 | // invisible to the user. |
Dominic Farolino | 4bc10ee | 2021-08-31 00:37:36 | [diff] [blame] | 184 | kPrerender, |
| 185 | |
| 186 | // This FrameTree is used to host the contents of a <fencedframe> element. |
| 187 | // Even for <fencedframe>s hosted inside a prerendered page, the FrameTree |
| 188 | // associated with the fenced frame will be kFencedFrame, but the |
| 189 | // RenderFrameHosts inside of it will have their lifecycle state set to |
| 190 | // `RenderFrameHost::LifecycleState::kActive`. |
| 191 | // |
| 192 | // TODO(crbug.com/1232528, crbug.com/1244274): We should either: |
| 193 | // * Fully support nested FrameTrees inside prerendered pages, in which |
| 194 | // case all of the RenderFrameHosts inside the nested trees should have |
| 195 | // their lifecycle state set to kPrerendering, or... |
| 196 | // * Ban nested FrameTrees in prerendered pages, and therefore obsolete the |
| 197 | // above paragraph about <fencedframe>s hosted in prerendered pages. |
| 198 | kFencedFrame |
Sreeja Kamishetty | 74bacd52 | 2021-03-22 17:04:24 | [diff] [blame] | 199 | }; |
Sreeja Kamishetty | 837a1040 | 2021-04-23 12:41:59 | [diff] [blame] | 200 | |
| 201 | // A set of delegates are remembered here so that we can create |
| 202 | // RenderFrameHostManagers. |
Dave Tapuska | 14457010 | 2022-08-02 19:28:27 | [diff] [blame] | 203 | // `dev_tools_frame_token` is the devtools token for the root `FrameTreeNode` |
| 204 | // of this new `FrameTree`. |
Sreeja Kamishetty | 837a1040 | 2021-04-23 12:41:59 | [diff] [blame] | 205 | FrameTree(BrowserContext* browser_context, |
| 206 | Delegate* delegate, |
| 207 | NavigationControllerDelegate* navigation_controller_delegate, |
| 208 | NavigatorDelegate* navigator_delegate, |
| 209 | RenderFrameHostDelegate* render_frame_delegate, |
| 210 | RenderViewHostDelegate* render_view_delegate, |
| 211 | RenderWidgetHostDelegate* render_widget_delegate, |
| 212 | RenderFrameHostManager::Delegate* manager_delegate, |
Jeremy Roman | 2d8dfe13 | 2021-07-06 20:51:26 | [diff] [blame] | 213 | PageDelegate* page_delegate, |
Dave Tapuska | 14457010 | 2022-08-02 19:28:27 | [diff] [blame] | 214 | Type type, |
| 215 | const base::UnguessableToken& devtools_frame_token); |
Peter Boström | 828b902 | 2021-09-21 02:28:43 | [diff] [blame] | 216 | |
| 217 | FrameTree(const FrameTree&) = delete; |
| 218 | FrameTree& operator=(const FrameTree&) = delete; |
| 219 | |
Sreeja Kamishetty | 837a1040 | 2021-04-23 12:41:59 | [diff] [blame] | 220 | ~FrameTree(); |
Sreeja Kamishetty | 74bacd52 | 2021-03-22 17:04:24 | [diff] [blame] | 221 | |
Carlos Caballero | 40b0efd | 2021-01-26 11:55:00 | [diff] [blame] | 222 | // Initializes the main frame for this FrameTree. That is it creates the |
Rakina Zata Amni | afd3c658 | 2021-11-30 06:19:17 | [diff] [blame] | 223 | // initial RenderFrameHost in the root node's RenderFrameHostManager, and also |
Rakina Zata Amni | 2322f4f8 | 2022-01-24 13:24:24 | [diff] [blame] | 224 | // creates an initial NavigationEntry (if the InitialNavigationEntry feature |
Rakina Zata Amni | 4eb716e | 2022-04-05 21:32:46 | [diff] [blame] | 225 | // is enabled) that potentially inherits `opener_for_origin`'s origin in its |
Rakina Zata Amni | 2322f4f8 | 2022-01-24 13:24:24 | [diff] [blame] | 226 | // NavigationController. This method will call back into the delegates so it |
| 227 | // should only be called once they have completed their initialization. Pass |
| 228 | // in frame_policy so that it can be set in the root node's replication_state. |
Carlos Caballero | 40b0efd | 2021-01-26 11:55:00 | [diff] [blame] | 229 | // TODO(carlscab): It would be great if initialization could happened in the |
| 230 | // constructor so we do not leave objects in a half initialized state. |
| 231 | void Init(SiteInstance* main_frame_site_instance, |
| 232 | bool renderer_initiated_creation, |
Rakina Zata Amni | afd3c658 | 2021-11-30 06:19:17 | [diff] [blame] | 233 | const std::string& main_frame_name, |
Rakina Zata Amni | 4eb716e | 2022-04-05 21:32:46 | [diff] [blame] | 234 | RenderFrameHostImpl* opener_for_origin, |
Harkiran Bolaria | 5ce2763 | 2022-01-20 15:05:05 | [diff] [blame] | 235 | const blink::FramePolicy& frame_policy); |
Sreeja Kamishetty | 837a1040 | 2021-04-23 12:41:59 | [diff] [blame] | 236 | |
| 237 | Type type() const { return type_; } |
Carlos Caballero | 40b0efd | 2021-01-26 11:55:00 | [diff] [blame] | 238 | |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 239 | FrameTreeNode* root() const { return root_; } |
| 240 | |
Sreeja Kamishetty | 74bacd52 | 2021-03-22 17:04:24 | [diff] [blame] | 241 | bool is_prerendering() const { return type_ == FrameTree::Type::kPrerender; } |
Sreeja Kamishetty | 46f762c | 2021-02-05 07:52:46 | [diff] [blame] | 242 | |
Sreeja Kamishetty | 60e4713 | 2022-02-08 12:51:53 | [diff] [blame] | 243 | // Returns true if this frame tree is a portal. |
| 244 | // |
| 245 | // TODO(crbug.com/1254770): Once portals are migrated to MPArch, portals will |
| 246 | // have their own FrameTree::Type. |
| 247 | bool IsPortal(); |
| 248 | |
Carlos Caballero | 0326252 | 2021-02-05 14:49:58 | [diff] [blame] | 249 | Delegate* delegate() { return delegate_; } |
| 250 | |
Jeremy Roman | 2d8dfe13 | 2021-07-06 20:51:26 | [diff] [blame] | 251 | // Delegates for various objects. These can be kept centrally on the |
| 252 | // FrameTree because they are expected to be the same for all frames on a |
| 253 | // given FrameTree. |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 254 | RenderFrameHostDelegate* render_frame_delegate() { |
| 255 | return render_frame_delegate_; |
| 256 | } |
| 257 | RenderViewHostDelegate* render_view_delegate() { |
| 258 | return render_view_delegate_; |
| 259 | } |
| 260 | RenderWidgetHostDelegate* render_widget_delegate() { |
| 261 | return render_widget_delegate_; |
| 262 | } |
| 263 | RenderFrameHostManager::Delegate* manager_delegate() { |
| 264 | return manager_delegate_; |
| 265 | } |
Jeremy Roman | 2d8dfe13 | 2021-07-06 20:51:26 | [diff] [blame] | 266 | PageDelegate* page_delegate() { return page_delegate_; } |
Aaron Colwell | 78b4bde | 2021-03-16 16:16:09 | [diff] [blame] | 267 | |
Albert J. Wong | 1b6dc96 | 2021-07-09 18:06:57 | [diff] [blame] | 268 | using RenderViewHostMapId = base::IdType32<class RenderViewHostMap>; |
Sharon Yang | c581a0c | 2021-11-02 18:09:39 | [diff] [blame] | 269 | |
| 270 | // SiteInstanceGroup IDs are used to look up RenderViewHosts, since there is |
| 271 | // one RenderViewHost per SiteInstanceGroup in a given FrameTree. |
Aaron Colwell | 78b4bde | 2021-03-16 16:16:09 | [diff] [blame] | 272 | using RenderViewHostMap = std::unordered_map<RenderViewHostMapId, |
| 273 | RenderViewHostImpl*, |
| 274 | RenderViewHostMapId::Hasher>; |
| 275 | const RenderViewHostMap& render_view_hosts() const { |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 276 | return render_view_host_map_; |
| 277 | } |
| 278 | |
| 279 | // Returns the FrameTreeNode with the given |frame_tree_node_id| if it is part |
| 280 | // of this FrameTree. |
| 281 | FrameTreeNode* FindByID(int frame_tree_node_id); |
| 282 | |
| 283 | // Returns the FrameTreeNode with the given renderer-specific |routing_id|. |
| 284 | FrameTreeNode* FindByRoutingID(int process_id, int routing_id); |
| 285 | |
| 286 | // Returns the first frame in this tree with the given |name|, or the main |
| 287 | // frame if |name| is empty. |
| 288 | // Note that this does NOT support pseudo-names like _self, _top, and _blank, |
| 289 | // nor searching other FrameTrees (unlike blink::WebView::findFrameByName). |
| 290 | FrameTreeNode* FindByName(const std::string& name); |
| 291 | |
| 292 | // Returns a range to iterate over all FrameTreeNodes in the frame tree in |
| 293 | // breadth-first traversal order. |
| 294 | NodeRange Nodes(); |
| 295 | |
| 296 | // Returns a range to iterate over all FrameTreeNodes in a subtree of the |
| 297 | // frame tree, starting from |subtree_root|. |
| 298 | NodeRange SubtreeNodes(FrameTreeNode* subtree_root); |
| 299 | |
Kevin McNee | 53f0b2d | 2021-11-02 18:00:45 | [diff] [blame] | 300 | // Returns a range to iterate over all FrameTreeNodes in this frame tree, as |
| 301 | // well as any FrameTreeNodes of inner frame trees. Note that this includes |
| 302 | // inner frame trees of inner WebContents as well. |
| 303 | NodeRange NodesIncludingInnerTreeNodes(); |
| 304 | |
Kevin McNee | 5f59438 | 2021-05-06 23:18:23 | [diff] [blame] | 305 | // Returns a range to iterate over all FrameTreeNodes in a subtree, starting |
| 306 | // from, but not including |parent|, as well as any FrameTreeNodes of inner |
Kevin McNee | 53f0b2d | 2021-11-02 18:00:45 | [diff] [blame] | 307 | // frame trees. Note that this includes inner frame trees of inner WebContents |
| 308 | // as well. |
Kevin McNee | 5f59438 | 2021-05-06 23:18:23 | [diff] [blame] | 309 | static NodeRange SubtreeAndInnerTreeNodes(RenderFrameHostImpl* parent); |
| 310 | |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 311 | // Adds a new child frame to the frame tree. |process_id| is required to |
| 312 | // disambiguate |new_routing_id|, and it must match the process of the |
Kevin McNee | 43fe829 | 2021-10-04 22:59:41 | [diff] [blame] | 313 | // |parent| node. Otherwise no child is added and this method returns nullptr. |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 314 | // |interface_provider_receiver| is the receiver end of the InterfaceProvider |
| 315 | // interface through which the child RenderFrame can access Mojo services |
| 316 | // exposed by the corresponding RenderFrameHost. The caller takes care of |
Antonio Sartori | db967c5 | 2021-01-20 09:54:30 | [diff] [blame] | 317 | // sending the client end of the interface down to the |
| 318 | // RenderFrame. |policy_container_bind_params|, if not null, is used for |
| 319 | // binding Blink's policy container to the new RenderFrameHost's |
| 320 | // PolicyContainerHost. This is only needed if this frame is the result of the |
| 321 | // CreateChildFrame mojo call, which also delivers the |
Kevin McNee | 43fe829 | 2021-10-04 22:59:41 | [diff] [blame] | 322 | // |policy_container_bind_params|. |is_dummy_frame_for_inner_tree| is true if |
| 323 | // the added frame is only to serve as a placeholder for an inner frame tree |
| 324 | // (e.g. fenced frames, portals) and will not have a live RenderFrame of its |
| 325 | // own. |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 326 | FrameTreeNode* AddFrame( |
| 327 | RenderFrameHostImpl* parent, |
| 328 | int process_id, |
| 329 | int new_routing_id, |
danakj | 0bdfacd | 2021-01-20 19:27:18 | [diff] [blame] | 330 | mojo::PendingAssociatedRemote<mojom::Frame> frame_remote, |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 331 | mojo::PendingReceiver<blink::mojom::BrowserInterfaceBroker> |
| 332 | browser_interface_broker_receiver, |
Antonio Sartori | db967c5 | 2021-01-20 09:54:30 | [diff] [blame] | 333 | blink::mojom::PolicyContainerBindParamsPtr policy_container_bind_params, |
Dominic Farolino | 12e06d7 | 2022-08-05 02:29:49 | [diff] [blame] | 334 | mojo::PendingAssociatedReceiver<blink::mojom::AssociatedInterfaceProvider> |
| 335 | associated_interface_provider_receiver, |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 336 | blink::mojom::TreeScopeType scope, |
| 337 | const std::string& frame_name, |
| 338 | const std::string& frame_unique_name, |
| 339 | bool is_created_by_script, |
Chris Hamilton | 3ff6ed0e | 2021-02-19 03:54:04 | [diff] [blame] | 340 | const blink::LocalFrameToken& frame_token, |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 341 | const base::UnguessableToken& devtools_frame_token, |
| 342 | const blink::FramePolicy& frame_policy, |
| 343 | const blink::mojom::FrameOwnerProperties& frame_owner_properties, |
| 344 | bool was_discarded, |
Kevin McNee | 43fe829 | 2021-10-04 22:59:41 | [diff] [blame] | 345 | blink::FrameOwnerElementType owner_type, |
| 346 | bool is_dummy_frame_for_inner_tree); |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 347 | |
| 348 | // Removes a frame from the frame tree. |child|, its children, and objects |
| 349 | // owned by their RenderFrameHostManagers are immediately deleted. The root |
| 350 | // node cannot be removed this way. |
| 351 | void RemoveFrame(FrameTreeNode* child); |
| 352 | |
| 353 | // This method walks the entire frame tree and creates a RenderFrameProxyHost |
| 354 | // for the given |site_instance| in each node except the |source| one -- |
| 355 | // the source will have a RenderFrameHost. |source| may be null if there is |
| 356 | // no node navigating in this frame tree (such as when this is called |
| 357 | // for an opener's frame tree), in which case no nodes are skipped for |
Harkiran Bolaria | 2912a6b3 | 2022-02-22 16:43:45 | [diff] [blame] | 358 | // RenderFrameProxyHost creation. |source_new_browsing_context_state| is the |
| 359 | // BrowsingContextState used by the speculative frame host, which may differ |
| 360 | // from the BrowsingContextState in |source| during cross-origin cross- |
| 361 | // browsing-instance navigations. |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 362 | void CreateProxiesForSiteInstance(FrameTreeNode* source, |
Harkiran Bolaria | 2912a6b3 | 2022-02-22 16:43:45 | [diff] [blame] | 363 | SiteInstance* site_instance, |
| 364 | const scoped_refptr<BrowsingContextState>& |
| 365 | source_new_browsing_context_state); |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 366 | |
| 367 | // Convenience accessor for the main frame's RenderFrameHostImpl. |
| 368 | RenderFrameHostImpl* GetMainFrame() const; |
| 369 | |
| 370 | // Returns the focused frame. |
| 371 | FrameTreeNode* GetFocusedFrame(); |
| 372 | |
Sharon Yang | efe5263 | 2022-03-08 23:06:06 | [diff] [blame] | 373 | // Sets the focused frame to |node|. |source| identifies the |
| 374 | // SiteInstanceGroup that initiated this focus change. If this FrameTree has |
| 375 | // SiteInstanceGroups other than |source|, those SiteInstanceGroups will be |
| 376 | // notified about the new focused frame. Note that |source| may differ from |
| 377 | // |node|'s current SiteInstanceGroup (e.g., this happens for cross-process |
| 378 | // window.focus() calls). |
| 379 | void SetFocusedFrame(FrameTreeNode* node, SiteInstanceGroup* source); |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 380 | |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 381 | // Creates a RenderViewHostImpl for a given |site_instance| in the tree. |
| 382 | // |
| 383 | // The RenderFrameHostImpls and the RenderFrameProxyHosts will share ownership |
| 384 | // of this object. |
| 385 | scoped_refptr<RenderViewHostImpl> CreateRenderViewHost( |
| 386 | SiteInstance* site_instance, |
| 387 | int32_t main_frame_routing_id, |
Harkiran Bolaria | 57e2b06 | 2022-03-14 10:27:58 | [diff] [blame] | 388 | bool renderer_initiated_creation, |
| 389 | scoped_refptr<BrowsingContextState> main_browsing_context_state); |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 390 | |
| 391 | // Returns the existing RenderViewHost for a new RenderFrameHost. |
| 392 | // There should always be such a RenderViewHost, because the main frame |
| 393 | // RenderFrameHost for each SiteInstance should be created before subframes. |
Sharon Yang | 57bde12 | 2022-03-01 20:01:12 | [diff] [blame] | 394 | scoped_refptr<RenderViewHostImpl> GetRenderViewHost(SiteInstanceGroup* group); |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 395 | |
Sharon Yang | c581a0c | 2021-11-02 18:09:39 | [diff] [blame] | 396 | // Returns the ID used for the RenderViewHost associated with |
| 397 | // |site_instance_group|. |
| 398 | RenderViewHostMapId GetRenderViewHostMapId( |
| 399 | SiteInstanceGroup* site_instance_group) const; |
Aaron Colwell | 78b4bde | 2021-03-16 16:16:09 | [diff] [blame] | 400 | |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 401 | // Registers a RenderViewHost so that it can be reused by other frames |
Aaron Colwell | 78b4bde | 2021-03-16 16:16:09 | [diff] [blame] | 402 | // whose SiteInstance maps to the same RenderViewHostMapId. |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 403 | // |
| 404 | // This method does not take ownership of|rvh|. |
| 405 | // |
| 406 | // NOTE: This method CHECK fails if a RenderViewHost is already registered for |
| 407 | // |rvh|'s SiteInstance. |
| 408 | // |
| 409 | // ALSO NOTE: After calling RegisterRenderViewHost, UnregisterRenderViewHost |
| 410 | // *must* be called for |rvh| when it is destroyed or put into the |
| 411 | // BackForwardCache, to prevent FrameTree::CreateRenderViewHost from trying to |
| 412 | // reuse it. |
Aaron Colwell | 78b4bde | 2021-03-16 16:16:09 | [diff] [blame] | 413 | void RegisterRenderViewHost(RenderViewHostMapId id, RenderViewHostImpl* rvh); |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 414 | |
| 415 | // Unregisters the RenderViewHostImpl that's available for reuse for a |
Aaron Colwell | 78b4bde | 2021-03-16 16:16:09 | [diff] [blame] | 416 | // particular RenderViewHostMapId. NOTE: This method CHECK fails if it is |
| 417 | // called for a |render_view_host| that is not currently set for reuse. |
| 418 | void UnregisterRenderViewHost(RenderViewHostMapId id, |
Aaron Colwell | c4bd7d6 | 2021-01-29 04:23:13 | [diff] [blame] | 419 | RenderViewHostImpl* render_view_host); |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 420 | |
| 421 | // This is called when the frame is about to be removed and started to run |
| 422 | // unload handlers. |
| 423 | void FrameUnloading(FrameTreeNode* frame); |
| 424 | |
| 425 | // This is only meant to be called by FrameTreeNode. Triggers calling |
| 426 | // the listener installed by SetFrameRemoveListener. |
| 427 | void FrameRemoved(FrameTreeNode* frame); |
| 428 | |
Carlos Caballero | 0326252 | 2021-02-05 14:49:58 | [diff] [blame] | 429 | void DidStartLoadingNode(FrameTreeNode& node, |
Nate Chapin | 9aabf5f | 2021-11-12 00:31:19 | [diff] [blame] | 430 | bool should_show_loading_ui, |
Carlos Caballero | 0326252 | 2021-02-05 14:49:58 | [diff] [blame] | 431 | bool was_previously_loading); |
| 432 | void DidStopLoadingNode(FrameTreeNode& node); |
Carlos Caballero | 0326252 | 2021-02-05 14:49:58 | [diff] [blame] | 433 | void DidCancelLoading(); |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 434 | |
Sreeja Kamishetty | 0be3b1b | 2021-08-12 17:04:15 | [diff] [blame] | 435 | // Returns this FrameTree's total load progress. If the `root_` FrameTreeNode |
| 436 | // is navigating returns `blink::kInitialLoadProgress`. |
| 437 | double GetLoadProgress(); |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 438 | |
Sreeja Kamishetty | 15f9944a2 | 2022-03-10 10:16:08 | [diff] [blame] | 439 | // Returns true if at least one of the nodes in this frame tree or nodes in |
| 440 | // any inner frame tree of the same WebContents is loading. |
Yu Gao | c8c1855 | 2022-06-22 14:38:45 | [diff] [blame] | 441 | bool IsLoadingIncludingInnerFrameTrees() const; |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 442 | |
| 443 | // Set page-level focus in all SiteInstances involved in rendering |
| 444 | // this FrameTree, not including the current main frame's |
| 445 | // SiteInstance. The focus update will be sent via the main frame's proxies |
| 446 | // in those SiteInstances. |
| 447 | void ReplicatePageFocus(bool is_focused); |
| 448 | |
| 449 | // Updates page-level focus for this FrameTree in the subframe renderer |
Sharon Yang | efe5263 | 2022-03-08 23:06:06 | [diff] [blame] | 450 | // identified by |group|. |
| 451 | void SetPageFocus(SiteInstanceGroup* group, bool is_focused); |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 452 | |
W. James MacLean | c07dc41b | 2022-07-25 18:52:16 | [diff] [blame] | 453 | // Walks the current frame tree and registers any origins matching |
| 454 | // `previously_visited_origin`, either the last committed origin of a |
| 455 | // RenderFrameHost or the origin associated with a NavigationRequest that has |
| 456 | // been assigned to a SiteInstance, as having the default origin isolation |
| 457 | // state. This is only necessary when `previously_visited_origin` is seen with |
| 458 | // an OriginAgentCluster header explicitly requesting something other than the |
| 459 | // default. |
| 460 | void RegisterExistingOriginAsHavingDefaultIsolation( |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 461 | const url::Origin& previously_visited_origin, |
| 462 | NavigationRequest* navigation_request_to_exclude); |
| 463 | |
Carlos Caballero | 40b0efd | 2021-01-26 11:55:00 | [diff] [blame] | 464 | NavigationControllerImpl& controller() { return navigator_.controller(); } |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 465 | Navigator& navigator() { return navigator_; } |
| 466 | |
Carlos Caballero | ede6f8c | 2021-01-28 11:01:50 | [diff] [blame] | 467 | // Another page accessed the initial empty main document, which means it |
| 468 | // is no longer safe to display a pending URL without risking a URL spoof. |
| 469 | void DidAccessInitialMainDocument(); |
| 470 | |
| 471 | bool has_accessed_initial_main_document() const { |
| 472 | return has_accessed_initial_main_document_; |
| 473 | } |
| 474 | |
| 475 | void ResetHasAccessedInitialMainDocument() { |
| 476 | has_accessed_initial_main_document_ = false; |
| 477 | } |
| 478 | |
Carlos Caballero | 6ff6ace | 2021-02-05 16:53:00 | [diff] [blame] | 479 | bool IsHidden() const { return delegate_->IsHidden(); } |
| 480 | |
Sreeja Kamishetty | d64b993d | 2022-02-14 12:04:42 | [diff] [blame] | 481 | // LoadingTree returns the following for different frame trees to direct |
| 482 | // loading related events. Please see FrameTree::Delegate::LoadingTree for |
| 483 | // more comments. |
| 484 | // - For prerender frame tree -> returns the frame tree itself. |
| 485 | // - For fenced frame and primary frame tree (including portal) -> returns |
| 486 | // the delegate's primary frame tree. |
| 487 | FrameTree* LoadingTree(); |
| 488 | |
Carlos Caballero | 0326252 | 2021-02-05 14:49:58 | [diff] [blame] | 489 | // Stops all ongoing navigations in each of the nodes of this FrameTree. |
| 490 | void StopLoading(); |
| 491 | |
Carlos Caballero | 101ac26b | 2021-03-24 11:54:05 | [diff] [blame] | 492 | // Prepares this frame tree for destruction, cleaning up the internal state |
| 493 | // and firing the appropriate events like FrameDeleted. |
| 494 | // Must be called before FrameTree is destroyed. |
| 495 | void Shutdown(); |
| 496 | |
Takashi Toyoshima | ea534ef2 | 2021-07-21 03:27:59 | [diff] [blame] | 497 | bool IsBeingDestroyed() const { return is_being_destroyed_; } |
| 498 | |
Dave Tapuska | d8b0530f | 2021-10-19 15:12:31 | [diff] [blame] | 499 | base::SafeRef<FrameTree> GetSafeRef(); |
| 500 | |
Dave Tapuska | 54c76a03 | 2021-10-27 22:10:42 | [diff] [blame] | 501 | // Walks up the FrameTree chain and focuses the FrameTreeNode where |
| 502 | // each inner FrameTree is attached. |
| 503 | void FocusOuterFrameTrees(); |
| 504 | |
David Bokan | c3fb5fa | 2022-07-04 14:55:31 | [diff] [blame] | 505 | absl::optional<blink::features::FencedFramesImplementationType> |
| 506 | FencedFramesImplementationType() const { |
| 507 | return fenced_frames_impl_; |
| 508 | } |
| 509 | |
| 510 | bool IsFencedFramesMPArchBased() const { |
| 511 | return fenced_frames_impl_.has_value() && |
| 512 | fenced_frames_impl_.value() == |
| 513 | blink::features::FencedFramesImplementationType::kMPArch; |
| 514 | } |
| 515 | bool IsFencedFramesShadowDOMBased() const { |
| 516 | return fenced_frames_impl_.has_value() && |
| 517 | fenced_frames_impl_.value() == |
| 518 | blink::features::FencedFramesImplementationType::kShadowDOM; |
| 519 | } |
| 520 | |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 521 | private: |
| 522 | friend class FrameTreeTest; |
| 523 | FRIEND_TEST_ALL_PREFIXES(RenderFrameHostImplBrowserTest, RemoveFocusedFrame); |
Sreeja Kamishetty | d64b993d | 2022-02-14 12:04:42 | [diff] [blame] | 524 | FRIEND_TEST_ALL_PREFIXES(PortalBrowserTest, NodesForIsLoading); |
Xiaochen Zhou | 6443f75 | 2022-08-10 16:40:46 | [diff] [blame] | 525 | FRIEND_TEST_ALL_PREFIXES(FencedFrameMPArchBrowserTest, NodesForIsLoading); |
Sharon Yang | 2f3304a | 2022-05-13 02:24:25 | [diff] [blame] | 526 | FRIEND_TEST_ALL_PREFIXES(RenderFrameHostManagerTest, |
| 527 | CreateRenderViewAfterProcessKillAndClosedProxy); |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 528 | |
| 529 | // Returns a range to iterate over all FrameTreeNodes in the frame tree in |
| 530 | // breadth-first traversal order, skipping the subtree rooted at |
| 531 | // |node|, but including |node| itself. |
| 532 | NodeRange NodesExceptSubtree(FrameTreeNode* node); |
| 533 | |
Sreeja Kamishetty | d64b993d | 2022-02-14 12:04:42 | [diff] [blame] | 534 | // Returns all FrameTreeNodes in this frame tree, as well as any |
| 535 | // FrameTreeNodes of inner frame trees. Note that this doesn't include inner |
| 536 | // frame trees of inner delegates. This is used to find the aggregate |
| 537 | // IsLoading value for a frame tree. |
| 538 | // |
| 539 | // TODO(crbug.com/1261928, crbug.com/1261928): Remove this method and directly |
| 540 | // rely on GetOutermostMainFrame() and NodesIncludingInnerTreeNodes() once |
| 541 | // portals and guest views are migrated to MPArch. |
| 542 | std::vector<FrameTreeNode*> CollectNodesForIsLoading(); |
| 543 | |
Keishi Hattori | 0e45c02 | 2021-11-27 09:25:52 | [diff] [blame] | 544 | const raw_ptr<Delegate> delegate_; |
Carlos Caballero | 0326252 | 2021-02-05 14:49:58 | [diff] [blame] | 545 | |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 546 | // These delegates are installed into all the RenderViewHosts and |
| 547 | // RenderFrameHosts that we create. |
Keishi Hattori | 0e45c02 | 2021-11-27 09:25:52 | [diff] [blame] | 548 | raw_ptr<RenderFrameHostDelegate> render_frame_delegate_; |
| 549 | raw_ptr<RenderViewHostDelegate> render_view_delegate_; |
| 550 | raw_ptr<RenderWidgetHostDelegate> render_widget_delegate_; |
| 551 | raw_ptr<RenderFrameHostManager::Delegate> manager_delegate_; |
| 552 | raw_ptr<PageDelegate> page_delegate_; |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 553 | |
| 554 | // The Navigator object responsible for managing navigations on this frame |
Carlos Caballero | 40b0efd | 2021-01-26 11:55:00 | [diff] [blame] | 555 | // tree. Each FrameTreeNode will default to using it for navigation tasks in |
| 556 | // the frame. |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 557 | Navigator navigator_; |
| 558 | |
Aaron Colwell | 78b4bde | 2021-03-16 16:16:09 | [diff] [blame] | 559 | // Map of RenderViewHostMapId to RenderViewHost. This allows us to look up the |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 560 | // RenderViewHost for a given SiteInstance when creating RenderFrameHosts. |
| 561 | // Each RenderViewHost maintains a refcount and is deleted when there are no |
| 562 | // more RenderFrameHosts or RenderFrameProxyHosts using it. |
Aaron Colwell | 78b4bde | 2021-03-16 16:16:09 | [diff] [blame] | 563 | RenderViewHostMap render_view_host_map_; |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 564 | |
Harkiran Bolaria | 16f2c48d | 2022-04-22 12:39:57 | [diff] [blame] | 565 | // Indicates type of frame tree. |
| 566 | const Type type_; |
| 567 | |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 568 | // This is an owned ptr to the root FrameTreeNode, which never changes over |
| 569 | // the lifetime of the FrameTree. It is not a scoped_ptr because we need the |
| 570 | // pointer to remain valid even while the FrameTreeNode is being destroyed, |
| 571 | // since it's common for a node to test whether it's the root node. |
Kalvin Lee | 75d7030 | 2022-07-20 19:22:03 | [diff] [blame] | 572 | // |
| 573 | // TODO(crbug.com/1298696): content_browsertests breaks with MTECheckedPtr |
| 574 | // enabled. Triage. |
| 575 | raw_ptr<FrameTreeNode, DanglingUntriagedDegradeToNoOpWhenMTE> root_; |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 576 | |
| 577 | int focused_frame_tree_node_id_; |
| 578 | |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 579 | // Overall load progress. |
| 580 | double load_progress_; |
| 581 | |
David Bokan | c3fb5fa | 2022-07-04 14:55:31 | [diff] [blame] | 582 | absl::optional<blink::features::FencedFramesImplementationType> |
| 583 | fenced_frames_impl_; |
| 584 | |
Carlos Caballero | ede6f8c | 2021-01-28 11:01:50 | [diff] [blame] | 585 | // Whether the initial empty page has been accessed by another page, making it |
| 586 | // unsafe to show the pending URL. Usually false unless another window tries |
| 587 | // to modify the blank page. Always false after the first commit. |
| 588 | bool has_accessed_initial_main_document_ = false; |
| 589 | |
Takashi Toyoshima | ea534ef2 | 2021-07-21 03:27:59 | [diff] [blame] | 590 | bool is_being_destroyed_ = false; |
| 591 | |
Carlos Caballero | 101ac26b | 2021-03-24 11:54:05 | [diff] [blame] | 592 | #if DCHECK_IS_ON() |
| 593 | // Whether Shutdown() was called. |
| 594 | bool was_shut_down_ = false; |
| 595 | #endif |
Dave Tapuska | d8b0530f | 2021-10-19 15:12:31 | [diff] [blame] | 596 | |
| 597 | base::WeakPtrFactory<FrameTree> weak_ptr_factory_{this}; |
danakj | c492bf8 | 2020-09-09 20:02:44 | [diff] [blame] | 598 | }; |
| 599 | |
| 600 | } // namespace content |
| 601 | |
| 602 | #endif // CONTENT_BROWSER_RENDERER_HOST_FRAME_TREE_H_ |