blob: 556d2df465739c8aa567488164f5acda6120b058 [file] [log] [blame]
danakjc492bf82020-09-09 20:02:441// 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 Caballero101ac26b2021-03-24 11:54:0517#include "base/dcheck_is_on.h"
danakjc492bf82020-09-09 20:02:4418#include "base/gtest_prod_util.h"
19#include "base/macros.h"
20#include "content/browser/renderer_host/navigator.h"
21#include "content/browser/renderer_host/navigator_delegate.h"
22#include "content/browser/renderer_host/render_frame_host_manager.h"
23#include "content/common/content_export.h"
24#include "mojo/public/cpp/bindings/pending_receiver.h"
25#include "services/service_manager/public/mojom/interface_provider.mojom.h"
Chris Hamilton3ff6ed0e2021-02-19 03:54:0426#include "third_party/blink/public/common/tokens/tokens.h"
danakjc492bf82020-09-09 20:02:4427#include "third_party/blink/public/mojom/frame/frame_owner_element_type.mojom.h"
28#include "third_party/blink/public/mojom/frame/frame_owner_properties.mojom-forward.h"
29
30namespace blink {
Lei Zhang4a867672021-07-19 06:30:1431namespace mojom {
32class BrowserInterfaceBroker;
33enum class TreeScopeType;
34} // namespace mojom
35
danakjc492bf82020-09-09 20:02:4436struct FramePolicy;
37} // namespace blink
38
39namespace content {
40
Carlos Caballero40b0efd2021-01-26 11:55:0041class BrowserContext;
Jeremy Roman2d8dfe132021-07-06 20:51:2642class PageDelegate;
Lei Zhang4a867672021-07-19 06:30:1443class PageImpl;
danakjc492bf82020-09-09 20:02:4444class RenderFrameHostDelegate;
45class RenderViewHostDelegate;
46class RenderViewHostImpl;
47class RenderFrameHostManager;
48class RenderWidgetHostDelegate;
Carlos Caballero40b0efd2021-01-26 11:55:0049class SiteInstance;
danakjc492bf82020-09-09 20:02:4450
51// Represents the frame tree for a page. With the exception of the main frame,
52// all FrameTreeNodes will be created/deleted in response to frame attach and
53// detach events in the DOM.
54//
55// The main frame's FrameTreeNode is special in that it is reused. This allows
56// it to serve as an anchor for state that needs to persist across top-level
57// page navigations.
58//
59// TODO(ajwong): Move NavigationController ownership to the main frame
60// FrameTreeNode. Possibly expose access to it from here.
61//
62// This object is only used on the UI thread.
63class CONTENT_EXPORT FrameTree {
64 public:
65 class NodeRange;
66
67 class CONTENT_EXPORT NodeIterator
68 : public std::iterator<std::forward_iterator_tag, FrameTreeNode> {
69 public:
70 NodeIterator(const NodeIterator& other);
71 ~NodeIterator();
72
73 NodeIterator& operator++();
Kevin McNee5f594382021-05-06 23:18:2374 // Advances the iterator and excludes the children of the current node
75 NodeIterator& AdvanceSkippingChildren();
danakjc492bf82020-09-09 20:02:4476
77 bool operator==(const NodeIterator& rhs) const;
78 bool operator!=(const NodeIterator& rhs) const { return !(*this == rhs); }
79
80 FrameTreeNode* operator*() { return current_node_; }
81
82 private:
Jayson Adams4db0bfe22021-07-15 19:24:0783 friend class FrameTreeTest;
danakjc492bf82020-09-09 20:02:4484 friend class NodeRange;
85
Kevin McNee5f594382021-05-06 23:18:2386 NodeIterator(const std::vector<FrameTreeNode*>& starting_nodes,
87 const FrameTreeNode* root_of_subtree_to_skip,
88 bool should_descend_into_inner_trees);
89
90 void AdvanceNode();
danakjc492bf82020-09-09 20:02:4491
92 FrameTreeNode* current_node_;
Kevin McNee5f594382021-05-06 23:18:2393 const FrameTreeNode* const root_of_subtree_to_skip_;
94 const bool should_descend_into_inner_trees_;
Jayson Adams4db0bfe22021-07-15 19:24:0795 base::circular_deque<FrameTreeNode*> queue_;
danakjc492bf82020-09-09 20:02:4496 };
97
98 class CONTENT_EXPORT NodeRange {
99 public:
Kevin McNee5f594382021-05-06 23:18:23100 NodeRange(const NodeRange&);
101 ~NodeRange();
102
danakjc492bf82020-09-09 20:02:44103 NodeIterator begin();
104 NodeIterator end();
105
106 private:
107 friend class FrameTree;
108
Kevin McNee5f594382021-05-06 23:18:23109 NodeRange(const std::vector<FrameTreeNode*>& starting_nodes,
110 const FrameTreeNode* root_of_subtree_to_skip,
111 bool should_descend_into_inner_trees);
danakjc492bf82020-09-09 20:02:44112
Kevin McNee5f594382021-05-06 23:18:23113 const std::vector<FrameTreeNode*> starting_nodes_;
114 const FrameTreeNode* const root_of_subtree_to_skip_;
115 const bool should_descend_into_inner_trees_;
danakjc492bf82020-09-09 20:02:44116 };
117
Carlos Caballero03262522021-02-05 14:49:58118 class CONTENT_EXPORT Delegate {
119 public:
120 // A RenderFrameHost in the specified |frame_tree_node| started loading a
121 // new document. This corresponds to browser UI starting to show a spinner
122 // or other visual indicator for loading. This method is only invoked if the
123 // FrameTree hadn't been previously loading. |to_different_document| will be
124 // true unless the load is a fragment navigation, or triggered by
125 // history.pushState/replaceState.
126 virtual void DidStartLoading(FrameTreeNode* frame_tree_node,
127 bool to_different_document) = 0;
128
Takashi Toyoshima74090df62021-03-09 14:34:57129 // This is called when all nodes in the FrameTree stopped loading. This
Carlos Caballero03262522021-02-05 14:49:58130 // corresponds to the browser UI stop showing a spinner or other visual
131 // indicator for loading.
132 virtual void DidStopLoading() = 0;
133
134 // The load progress was changed.
135 virtual void DidChangeLoadProgress() = 0;
Carlos Caballero6ff6ace2021-02-05 16:53:00136
137 // Returns true when the active RenderWidgetHostView should be hidden.
138 virtual bool IsHidden() = 0;
Sreeja Kamishettya21b4f62021-06-25 07:48:25139
Sreeja Kamishetty53468972021-07-13 11:53:32140 // Called when current Page of this frame tree changes to `page`.
141 virtual void NotifyPageChanged(PageImpl& page) = 0;
Dominic Farolinoedf44ee2021-07-20 23:50:59142
143 // If the FrameTree using this delegate is an inner/nested FrameTree, then
144 // there may be a FrameTreeNode in the outer FrameTree that is considered
145 // our outer delegate FrameTreeNode. This method returns the outer delegate
146 // FrameTreeNode ID if one exists. If we don't have a an outer delegate
147 // FrameTreeNode, this method returns
148 // FrameTreeNode::kFrameTreeNodeInvalidId.
149 virtual int GetOuterDelegateFrameTreeNodeId() = 0;
Carlos Caballero03262522021-02-05 14:49:58150 };
151
Sreeja Kamishetty74bacd522021-03-22 17:04:24152 // Type of FrameTree instance.
153 enum class Type {
154 // This FrameTree is the primary frame tree for the WebContents, whose main
155 // document URL is shown in the Omnibox.
156 kPrimary,
157
158 // This FrameTree is used to prerender a page in the background which is
159 // invisible to the user.
160 kPrerender
161 };
Sreeja Kamishetty837a10402021-04-23 12:41:59162
163 // A set of delegates are remembered here so that we can create
164 // RenderFrameHostManagers.
165 FrameTree(BrowserContext* browser_context,
166 Delegate* delegate,
167 NavigationControllerDelegate* navigation_controller_delegate,
168 NavigatorDelegate* navigator_delegate,
169 RenderFrameHostDelegate* render_frame_delegate,
170 RenderViewHostDelegate* render_view_delegate,
171 RenderWidgetHostDelegate* render_widget_delegate,
172 RenderFrameHostManager::Delegate* manager_delegate,
Jeremy Roman2d8dfe132021-07-06 20:51:26173 PageDelegate* page_delegate,
Sreeja Kamishetty837a10402021-04-23 12:41:59174 Type type);
175 ~FrameTree();
Sreeja Kamishetty74bacd522021-03-22 17:04:24176
Carlos Caballero40b0efd2021-01-26 11:55:00177 // Initializes the main frame for this FrameTree. That is it creates the
178 // initial RenderFrameHost in the root node's RenderFrameHostManager. This
179 // method will call back into the delegates so it should only be called once
180 // they have completed their initialization.
181 // TODO(carlscab): It would be great if initialization could happened in the
182 // constructor so we do not leave objects in a half initialized state.
183 void Init(SiteInstance* main_frame_site_instance,
184 bool renderer_initiated_creation,
Sreeja Kamishetty837a10402021-04-23 12:41:59185 const std::string& main_frame_name);
186
187 Type type() const { return type_; }
Carlos Caballero40b0efd2021-01-26 11:55:00188
danakjc492bf82020-09-09 20:02:44189 FrameTreeNode* root() const { return root_; }
190
Sreeja Kamishetty74bacd522021-03-22 17:04:24191 bool is_prerendering() const { return type_ == FrameTree::Type::kPrerender; }
Sreeja Kamishetty46f762c2021-02-05 07:52:46192
Carlos Caballero03262522021-02-05 14:49:58193 Delegate* delegate() { return delegate_; }
194
Jeremy Roman2d8dfe132021-07-06 20:51:26195 // Delegates for various objects. These can be kept centrally on the
196 // FrameTree because they are expected to be the same for all frames on a
197 // given FrameTree.
danakjc492bf82020-09-09 20:02:44198 RenderFrameHostDelegate* render_frame_delegate() {
199 return render_frame_delegate_;
200 }
201 RenderViewHostDelegate* render_view_delegate() {
202 return render_view_delegate_;
203 }
204 RenderWidgetHostDelegate* render_widget_delegate() {
205 return render_widget_delegate_;
206 }
207 RenderFrameHostManager::Delegate* manager_delegate() {
208 return manager_delegate_;
209 }
Jeremy Roman2d8dfe132021-07-06 20:51:26210 PageDelegate* page_delegate() { return page_delegate_; }
Aaron Colwell78b4bde2021-03-16 16:16:09211
Albert J. Wong1b6dc962021-07-09 18:06:57212 using RenderViewHostMapId = base::IdType32<class RenderViewHostMap>;
Aaron Colwell78b4bde2021-03-16 16:16:09213 using RenderViewHostMap = std::unordered_map<RenderViewHostMapId,
214 RenderViewHostImpl*,
215 RenderViewHostMapId::Hasher>;
216 const RenderViewHostMap& render_view_hosts() const {
danakjc492bf82020-09-09 20:02:44217 return render_view_host_map_;
218 }
219
220 // Returns the FrameTreeNode with the given |frame_tree_node_id| if it is part
221 // of this FrameTree.
222 FrameTreeNode* FindByID(int frame_tree_node_id);
223
224 // Returns the FrameTreeNode with the given renderer-specific |routing_id|.
225 FrameTreeNode* FindByRoutingID(int process_id, int routing_id);
226
227 // Returns the first frame in this tree with the given |name|, or the main
228 // frame if |name| is empty.
229 // Note that this does NOT support pseudo-names like _self, _top, and _blank,
230 // nor searching other FrameTrees (unlike blink::WebView::findFrameByName).
231 FrameTreeNode* FindByName(const std::string& name);
232
233 // Returns a range to iterate over all FrameTreeNodes in the frame tree in
234 // breadth-first traversal order.
235 NodeRange Nodes();
236
237 // Returns a range to iterate over all FrameTreeNodes in a subtree of the
238 // frame tree, starting from |subtree_root|.
239 NodeRange SubtreeNodes(FrameTreeNode* subtree_root);
240
Kevin McNee5f594382021-05-06 23:18:23241 // Returns a range to iterate over all FrameTreeNodes in a subtree, starting
242 // from, but not including |parent|, as well as any FrameTreeNodes of inner
243 // frame trees.
244 static NodeRange SubtreeAndInnerTreeNodes(RenderFrameHostImpl* parent);
245
danakjc492bf82020-09-09 20:02:44246 // Adds a new child frame to the frame tree. |process_id| is required to
247 // disambiguate |new_routing_id|, and it must match the process of the
248 // |parent| node. Otherwise no child is added and this method returns false.
249 // |interface_provider_receiver| is the receiver end of the InterfaceProvider
250 // interface through which the child RenderFrame can access Mojo services
251 // exposed by the corresponding RenderFrameHost. The caller takes care of
Antonio Sartoridb967c52021-01-20 09:54:30252 // sending the client end of the interface down to the
253 // RenderFrame. |policy_container_bind_params|, if not null, is used for
254 // binding Blink's policy container to the new RenderFrameHost's
255 // PolicyContainerHost. This is only needed if this frame is the result of the
256 // CreateChildFrame mojo call, which also delivers the
257 // |policy_container_bind_params|.
danakjc492bf82020-09-09 20:02:44258 FrameTreeNode* AddFrame(
259 RenderFrameHostImpl* parent,
260 int process_id,
261 int new_routing_id,
danakj0bdfacd2021-01-20 19:27:18262 mojo::PendingAssociatedRemote<mojom::Frame> frame_remote,
danakjc492bf82020-09-09 20:02:44263 mojo::PendingReceiver<blink::mojom::BrowserInterfaceBroker>
264 browser_interface_broker_receiver,
Antonio Sartoridb967c52021-01-20 09:54:30265 blink::mojom::PolicyContainerBindParamsPtr policy_container_bind_params,
danakjc492bf82020-09-09 20:02:44266 blink::mojom::TreeScopeType scope,
267 const std::string& frame_name,
268 const std::string& frame_unique_name,
269 bool is_created_by_script,
Chris Hamilton3ff6ed0e2021-02-19 03:54:04270 const blink::LocalFrameToken& frame_token,
danakjc492bf82020-09-09 20:02:44271 const base::UnguessableToken& devtools_frame_token,
272 const blink::FramePolicy& frame_policy,
273 const blink::mojom::FrameOwnerProperties& frame_owner_properties,
274 bool was_discarded,
275 blink::mojom::FrameOwnerElementType owner_type);
276
277 // Removes a frame from the frame tree. |child|, its children, and objects
278 // owned by their RenderFrameHostManagers are immediately deleted. The root
279 // node cannot be removed this way.
280 void RemoveFrame(FrameTreeNode* child);
281
282 // This method walks the entire frame tree and creates a RenderFrameProxyHost
283 // for the given |site_instance| in each node except the |source| one --
284 // the source will have a RenderFrameHost. |source| may be null if there is
285 // no node navigating in this frame tree (such as when this is called
286 // for an opener's frame tree), in which case no nodes are skipped for
287 // RenderFrameProxyHost creation.
288 void CreateProxiesForSiteInstance(FrameTreeNode* source,
289 SiteInstance* site_instance);
290
291 // Convenience accessor for the main frame's RenderFrameHostImpl.
292 RenderFrameHostImpl* GetMainFrame() const;
293
294 // Returns the focused frame.
295 FrameTreeNode* GetFocusedFrame();
296
297 // Sets the focused frame to |node|. |source| identifies the SiteInstance
298 // that initiated this focus change. If this FrameTree has SiteInstances
299 // other than |source|, those SiteInstances will be notified about the new
300 // focused frame. Note that |source| may differ from |node|'s current
301 // SiteInstance (e.g., this happens for cross-process window.focus() calls).
302 void SetFocusedFrame(FrameTreeNode* node, SiteInstance* source);
303
danakjc492bf82020-09-09 20:02:44304 // Creates a RenderViewHostImpl for a given |site_instance| in the tree.
305 //
306 // The RenderFrameHostImpls and the RenderFrameProxyHosts will share ownership
307 // of this object.
308 scoped_refptr<RenderViewHostImpl> CreateRenderViewHost(
309 SiteInstance* site_instance,
310 int32_t main_frame_routing_id,
danakj08eb51d2020-12-30 20:15:23311 bool swapped_out,
312 bool renderer_initiated_creation);
danakjc492bf82020-09-09 20:02:44313
314 // Returns the existing RenderViewHost for a new RenderFrameHost.
315 // There should always be such a RenderViewHost, because the main frame
316 // RenderFrameHost for each SiteInstance should be created before subframes.
317 scoped_refptr<RenderViewHostImpl> GetRenderViewHost(
318 SiteInstance* site_instance);
319
Aaron Colwell78b4bde2021-03-16 16:16:09320 // Returns the ID used for the RenderViewHost associated with |site_instance|.
321 // Note: Callers should not assume that there is a 1:1 mapping between
322 // SiteInstances and IDs returned by this function, since several
323 // SiteInstances may share a RenderViewHost.
324 RenderViewHostMapId GetRenderViewHostMapId(SiteInstance* site_instance) const;
325
danakjc492bf82020-09-09 20:02:44326 // Registers a RenderViewHost so that it can be reused by other frames
Aaron Colwell78b4bde2021-03-16 16:16:09327 // whose SiteInstance maps to the same RenderViewHostMapId.
danakjc492bf82020-09-09 20:02:44328 //
329 // This method does not take ownership of|rvh|.
330 //
331 // NOTE: This method CHECK fails if a RenderViewHost is already registered for
332 // |rvh|'s SiteInstance.
333 //
334 // ALSO NOTE: After calling RegisterRenderViewHost, UnregisterRenderViewHost
335 // *must* be called for |rvh| when it is destroyed or put into the
336 // BackForwardCache, to prevent FrameTree::CreateRenderViewHost from trying to
337 // reuse it.
Aaron Colwell78b4bde2021-03-16 16:16:09338 void RegisterRenderViewHost(RenderViewHostMapId id, RenderViewHostImpl* rvh);
danakjc492bf82020-09-09 20:02:44339
340 // Unregisters the RenderViewHostImpl that's available for reuse for a
Aaron Colwell78b4bde2021-03-16 16:16:09341 // particular RenderViewHostMapId. NOTE: This method CHECK fails if it is
342 // called for a |render_view_host| that is not currently set for reuse.
343 void UnregisterRenderViewHost(RenderViewHostMapId id,
Aaron Colwellc4bd7d62021-01-29 04:23:13344 RenderViewHostImpl* render_view_host);
danakjc492bf82020-09-09 20:02:44345
346 // This is called when the frame is about to be removed and started to run
347 // unload handlers.
348 void FrameUnloading(FrameTreeNode* frame);
349
350 // This is only meant to be called by FrameTreeNode. Triggers calling
351 // the listener installed by SetFrameRemoveListener.
352 void FrameRemoved(FrameTreeNode* frame);
353
Carlos Caballero03262522021-02-05 14:49:58354 void DidStartLoadingNode(FrameTreeNode& node,
355 bool to_different_document,
356 bool was_previously_loading);
357 void DidStopLoadingNode(FrameTreeNode& node);
358 void DidChangeLoadProgressForNode(FrameTreeNode& node, double load_progress);
359 void DidCancelLoading();
danakjc492bf82020-09-09 20:02:44360
361 // Returns this FrameTree's total load progress.
362 double load_progress() const { return load_progress_; }
363
364 // Resets the load progress on all nodes in this FrameTree.
365 void ResetLoadProgress();
366
367 // Returns true if at least one of the nodes in this FrameTree is loading.
368 bool IsLoading() const;
369
370 // Set page-level focus in all SiteInstances involved in rendering
371 // this FrameTree, not including the current main frame's
372 // SiteInstance. The focus update will be sent via the main frame's proxies
373 // in those SiteInstances.
374 void ReplicatePageFocus(bool is_focused);
375
376 // Updates page-level focus for this FrameTree in the subframe renderer
377 // identified by |instance|.
378 void SetPageFocus(SiteInstance* instance, bool is_focused);
379
380 // Walks the current frame tree and registers any origins matching |origin|,
381 // either the last committed origin of a RenderFrameHost or the origin
382 // associated with a NavigationRequest that has been assigned to a
383 // SiteInstance, as not-opted-in for origin isolation.
384 void RegisterExistingOriginToPreventOptInIsolation(
385 const url::Origin& previously_visited_origin,
386 NavigationRequest* navigation_request_to_exclude);
387
Carlos Caballero40b0efd2021-01-26 11:55:00388 NavigationControllerImpl& controller() { return navigator_.controller(); }
danakjc492bf82020-09-09 20:02:44389 Navigator& navigator() { return navigator_; }
390
Carlos Caballeroede6f8c2021-01-28 11:01:50391 // Another page accessed the initial empty main document, which means it
392 // is no longer safe to display a pending URL without risking a URL spoof.
393 void DidAccessInitialMainDocument();
394
395 bool has_accessed_initial_main_document() const {
396 return has_accessed_initial_main_document_;
397 }
398
399 void ResetHasAccessedInitialMainDocument() {
400 has_accessed_initial_main_document_ = false;
401 }
402
Carlos Caballero6ff6ace2021-02-05 16:53:00403 bool IsHidden() const { return delegate_->IsHidden(); }
404
Carlos Caballero03262522021-02-05 14:49:58405 // Stops all ongoing navigations in each of the nodes of this FrameTree.
406 void StopLoading();
407
Carlos Caballero101ac26b2021-03-24 11:54:05408 // Prepares this frame tree for destruction, cleaning up the internal state
409 // and firing the appropriate events like FrameDeleted.
410 // Must be called before FrameTree is destroyed.
411 void Shutdown();
412
shivanigithub93878d02021-06-15 11:37:53413 // Returns true if this is a fenced frame tree.
414 // TODO(crbug.com/1123606): Integrate this with the MPArch based fenced frame
415 // code once that lands.
416 bool IsFencedFrameTree() const { return is_fenced_frame_tree_; }
417 void SetFencedFrameTreeForTesting() { is_fenced_frame_tree_ = true; }
418
Takashi Toyoshimaea534ef22021-07-21 03:27:59419 bool IsBeingDestroyed() const { return is_being_destroyed_; }
420
danakjc492bf82020-09-09 20:02:44421 private:
422 friend class FrameTreeTest;
423 FRIEND_TEST_ALL_PREFIXES(RenderFrameHostImplBrowserTest, RemoveFocusedFrame);
424
425 // Returns a range to iterate over all FrameTreeNodes in the frame tree in
426 // breadth-first traversal order, skipping the subtree rooted at
427 // |node|, but including |node| itself.
428 NodeRange NodesExceptSubtree(FrameTreeNode* node);
429
Carlos Caballero03262522021-02-05 14:49:58430 Delegate* const delegate_;
431
danakjc492bf82020-09-09 20:02:44432 // These delegates are installed into all the RenderViewHosts and
433 // RenderFrameHosts that we create.
434 RenderFrameHostDelegate* render_frame_delegate_;
435 RenderViewHostDelegate* render_view_delegate_;
436 RenderWidgetHostDelegate* render_widget_delegate_;
437 RenderFrameHostManager::Delegate* manager_delegate_;
Jeremy Roman2d8dfe132021-07-06 20:51:26438 PageDelegate* page_delegate_;
danakjc492bf82020-09-09 20:02:44439
440 // The Navigator object responsible for managing navigations on this frame
Carlos Caballero40b0efd2021-01-26 11:55:00441 // tree. Each FrameTreeNode will default to using it for navigation tasks in
442 // the frame.
danakjc492bf82020-09-09 20:02:44443 Navigator navigator_;
444
Aaron Colwell78b4bde2021-03-16 16:16:09445 // Map of RenderViewHostMapId to RenderViewHost. This allows us to look up the
danakjc492bf82020-09-09 20:02:44446 // RenderViewHost for a given SiteInstance when creating RenderFrameHosts.
447 // Each RenderViewHost maintains a refcount and is deleted when there are no
448 // more RenderFrameHosts or RenderFrameProxyHosts using it.
Aaron Colwell78b4bde2021-03-16 16:16:09449 RenderViewHostMap render_view_host_map_;
danakjc492bf82020-09-09 20:02:44450
451 // This is an owned ptr to the root FrameTreeNode, which never changes over
452 // the lifetime of the FrameTree. It is not a scoped_ptr because we need the
453 // pointer to remain valid even while the FrameTreeNode is being destroyed,
454 // since it's common for a node to test whether it's the root node.
455 FrameTreeNode* root_;
456
457 int focused_frame_tree_node_id_;
458
danakjc492bf82020-09-09 20:02:44459 // Overall load progress.
460 double load_progress_;
461
Carlos Caballeroede6f8c2021-01-28 11:01:50462 // Whether the initial empty page has been accessed by another page, making it
463 // unsafe to show the pending URL. Usually false unless another window tries
464 // to modify the blank page. Always false after the first commit.
465 bool has_accessed_initial_main_document_ = false;
466
Sreeja Kamishetty837a10402021-04-23 12:41:59467 // Indicates type of frame tree.
468 const Type type_;
Sreeja Kamishetty74bacd522021-03-22 17:04:24469
shivanigithub93878d02021-06-15 11:37:53470 // TODO(crbug.com/1123606): Integrate this with the MPArch based fenced frame
471 // code once that lands. Possibly this will then be part of |type_|.
472 bool is_fenced_frame_tree_ = false;
473
Takashi Toyoshimaea534ef22021-07-21 03:27:59474 bool is_being_destroyed_ = false;
475
Carlos Caballero101ac26b2021-03-24 11:54:05476#if DCHECK_IS_ON()
477 // Whether Shutdown() was called.
478 bool was_shut_down_ = false;
479#endif
480
danakjc492bf82020-09-09 20:02:44481 DISALLOW_COPY_AND_ASSIGN(FrameTree);
482};
483
484} // namespace content
485
486#endif // CONTENT_BROWSER_RENDERER_HOST_FRAME_TREE_H_