blob: d9f29873384697aedc574d65070f433a32a84677 [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_NODE_H_
6#define CONTENT_BROWSER_RENDERER_HOST_FRAME_TREE_NODE_H_
7
8#include <stddef.h>
9
10#include <memory>
11#include <string>
12#include <vector>
13
14#include "base/gtest_prod_util.h"
15#include "base/macros.h"
16#include "base/memory/ref_counted.h"
17#include "content/browser/renderer_host/frame_tree.h"
18#include "content/browser/renderer_host/frame_tree_node_blame_context.h"
19#include "content/browser/renderer_host/navigator.h"
20#include "content/browser/renderer_host/render_frame_host_impl.h"
21#include "content/browser/renderer_host/render_frame_host_manager.h"
22#include "content/common/content_export.h"
23#include "content/common/frame_replication_state.h"
24#include "services/network/public/mojom/content_security_policy.mojom-forward.h"
25#include "third_party/blink/public/common/frame/frame_policy.h"
26#include "third_party/blink/public/common/frame/user_activation_state.h"
27#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.h"
29#include "third_party/blink/public/mojom/frame/user_activation_update_types.mojom.h"
30#include "third_party/blink/public/mojom/security_context/insecure_request_policy.mojom-forward.h"
31
32#include "url/gurl.h"
33#include "url/origin.h"
34
35namespace content {
36
37class NavigationRequest;
38class RenderFrameHostImpl;
39class NavigationEntryImpl;
40
41// When a page contains iframes, its renderer process maintains a tree structure
42// of those frames. We are mirroring this tree in the browser process. This
43// class represents a node in this tree and is a wrapper for all objects that
44// are frame-specific (as opposed to page-specific).
45//
46// Each FrameTreeNode has a current RenderFrameHost, which can change over
47// time as the frame is navigated. Any immediate subframes of the current
48// document are tracked using FrameTreeNodes owned by the current
49// RenderFrameHost, rather than as children of FrameTreeNode itself. This
50// allows subframe FrameTreeNodes to stay alive while a RenderFrameHost is
51// still alive - for example while pending deletion, after a new current
52// RenderFrameHost has replaced it.
53class CONTENT_EXPORT FrameTreeNode {
54 public:
55 class Observer {
56 public:
57 // Invoked when a FrameTreeNode is being destroyed.
58 virtual void OnFrameTreeNodeDestroyed(FrameTreeNode* node) {}
59
60 // Invoked when a FrameTreeNode becomes focused.
61 virtual void OnFrameTreeNodeFocused(FrameTreeNode* node) {}
62
63 virtual ~Observer() {}
64 };
65
66 static const int kFrameTreeNodeInvalidId;
67
68 // Returns the FrameTreeNode with the given global |frame_tree_node_id|,
69 // regardless of which FrameTree it is in.
70 static FrameTreeNode* GloballyFindByID(int frame_tree_node_id);
71
72 // Returns the FrameTreeNode for the given |rfh|. Same as
73 // rfh->frame_tree_node(), but also supports nullptrs.
74 static FrameTreeNode* From(RenderFrameHost* rfh);
75
76 // Callers are are expected to initialize sandbox flags separately after
77 // calling the constructor.
78 FrameTreeNode(
79 FrameTree* frame_tree,
80 RenderFrameHostImpl* parent,
81 blink::mojom::TreeScopeType scope,
82 const std::string& name,
83 const std::string& unique_name,
84 bool is_created_by_script,
85 const base::UnguessableToken& devtools_frame_token,
86 const blink::mojom::FrameOwnerProperties& frame_owner_properties,
87 blink::mojom::FrameOwnerElementType owner_type);
88
89 ~FrameTreeNode();
90
91 void AddObserver(Observer* observer);
92 void RemoveObserver(Observer* observer);
93
94 bool IsMainFrame() const;
95
arthursonzogni76098e52020-11-25 14:18:4596 // Clears any state in this node which was set by the document itself (CSP &
97 // UserActivationState) and notifies proxies as appropriate. Invoked after
98 // committing navigation to a new document (since the new document comes with
99 // a fresh set of CSP).
100 // TODO(arthursonzogni): Remove this function. The frame/document must not be
101 // left temporarily with lax state.
102 void ResetForNavigation(bool was_served_from_back_forward_cache);
danakjc492bf82020-09-09 20:02:44103
104 FrameTree* frame_tree() const { return frame_tree_; }
105 Navigator& navigator() { return frame_tree()->navigator(); }
106
107 RenderFrameHostManager* render_manager() { return &render_manager_; }
108 int frame_tree_node_id() const { return frame_tree_node_id_; }
109 const std::string& frame_name() const { return replication_state_.name; }
110
111 const std::string& unique_name() const {
112 return replication_state_.unique_name;
113 }
114
115 // See comment on the member declaration.
116 const base::UnguessableToken& devtools_frame_token() const {
117 return devtools_frame_token_;
118 }
119
120 size_t child_count() const { return current_frame_host()->child_count(); }
121
122 unsigned int depth() const { return depth_; }
123
124 RenderFrameHostImpl* parent() const { return parent_; }
125
126 FrameTreeNode* opener() const { return opener_; }
127
128 FrameTreeNode* original_opener() const { return original_opener_; }
129
Wolfgang Beyerd8809db2020-09-30 15:29:39130 const base::Optional<base::UnguessableToken>& opener_devtools_frame_token() {
131 return opener_devtools_frame_token_;
132 }
133
danakjc492bf82020-09-09 20:02:44134 // Gets the total number of descendants to this FrameTreeNode in addition to
135 // this node.
136 size_t GetFrameTreeSize() const;
137
138 // Assigns a new opener for this node and, if |opener| is non-null, registers
139 // an observer that will clear this node's opener if |opener| is ever
140 // destroyed.
141 void SetOpener(FrameTreeNode* opener);
142
143 // Assigns the initial opener for this node, and if |opener| is non-null,
144 // registers an observer that will clear this node's opener if |opener| is
145 // ever destroyed. The value set here is the root of the tree.
146 //
147 // It is not possible to change the opener once it was set.
148 void SetOriginalOpener(FrameTreeNode* opener);
149
Wolfgang Beyerd8809db2020-09-30 15:29:39150 // Assigns an opener frame id for this node. This string id is only set once
151 // and cannot be changed. It persists, even if the |opener| is destroyed. It
152 // is used for attribution in the DevTools frontend.
153 void SetOpenerDevtoolsFrameToken(
154 base::UnguessableToken opener_devtools_frame_token);
155
danakjc492bf82020-09-09 20:02:44156 FrameTreeNode* child_at(size_t index) const {
157 return current_frame_host()->child_at(index);
158 }
159
160 // Returns the URL of the last committed page in the current frame.
161 const GURL& current_url() const {
162 return current_frame_host()->GetLastCommittedURL();
163 }
164
165 // Sets the last committed URL for this frame and updates
166 // has_committed_real_load accordingly.
167 void SetCurrentURL(const GURL& url);
168
169 // Returns true iff SetCurrentURL has been called with a non-blank URL.
170 bool has_committed_real_load() const { return has_committed_real_load_; }
171
172 // Returns whether the frame's owner element in the parent document is
173 // collapsed, that is, removed from the layout as if it did not exist, as per
174 // request by the embedder (of the content/ layer).
175 bool is_collapsed() const { return is_collapsed_; }
176
177 // Sets whether to collapse the frame's owner element in the parent document,
178 // that is, to remove it from the layout as if it did not exist, as per
179 // request by the embedder (of the content/ layer). Cannot be called for main
180 // frames.
181 //
182 // This only has an effect for <iframe> owner elements, and is a no-op when
183 // called on sub-frames hosted in <frame>, <object>, and <embed> elements.
184 void SetCollapsed(bool collapsed);
185
186 // Returns the origin of the last committed page in this frame.
187 // WARNING: To get the last committed origin for a particular
188 // RenderFrameHost, use RenderFrameHost::GetLastCommittedOrigin() instead,
189 // which will behave correctly even when the RenderFrameHost is not the
190 // current one for this frame (such as when it's pending deletion).
191 const url::Origin& current_origin() const {
192 return replication_state_.origin;
193 }
194
195 // Set the current origin and notify proxies about the update.
196 void SetCurrentOrigin(const url::Origin& origin,
197 bool is_potentially_trustworthy_unique_origin);
198
199 // Set the current name and notify proxies about the update.
200 void SetFrameName(const std::string& name, const std::string& unique_name);
201
202 // Add CSP headers to replication state, notify proxies about the update.
203 void AddContentSecurityPolicies(
204 std::vector<network::mojom::ContentSecurityPolicyHeaderPtr> headers);
205
206 // Sets the current insecure request policy, and notifies proxies about the
207 // update.
208 void SetInsecureRequestPolicy(blink::mojom::InsecureRequestPolicy policy);
209
210 // Sets the current set of insecure urls to upgrade, and notifies proxies
211 // about the update.
212 void SetInsecureNavigationsSet(
213 const std::vector<uint32_t>& insecure_navigations_set);
214
215 // Returns the latest frame policy (sandbox flags and container policy) for
216 // this frame. This includes flags inherited from parent frames and the latest
217 // flags from the <iframe> element hosting this frame. The returned policies
218 // may not yet have taken effect, since "sandbox" and "allow" attribute
219 // updates in an <iframe> element take effect on next navigation. To retrieve
220 // the currently active policy for this frame, use effective_frame_policy().
221 const blink::FramePolicy& pending_frame_policy() const {
222 return pending_frame_policy_;
223 }
224
225 // Update this frame's sandbox flags and container policy. This is called
226 // when a parent frame updates the "sandbox" attribute in the <iframe> element
227 // for this frame, or any of the attributes which affect the container policy
228 // ("allowfullscreen", "allowpaymentrequest", "allow", and "src".)
229 // These policies won't take effect until next navigation. If this frame's
230 // parent is itself sandboxed, the parent's sandbox flags are combined with
231 // those in |frame_policy|.
232 // Attempting to change the container policy on the main frame will have no
233 // effect.
234 void SetPendingFramePolicy(blink::FramePolicy frame_policy);
235
236 // Returns the currently active frame policy for this frame, including the
237 // sandbox flags which were present at the time the document was loaded, and
238 // the feature policy container policy, which is set by the iframe's
239 // allowfullscreen, allowpaymentrequest, and allow attributes, along with the
240 // origin of the iframe's src attribute (which may be different from the URL
241 // of the document currently loaded into the frame). This does not include
242 // policy changes that have been made by updating the containing iframe
243 // element attributes since the frame was last navigated; use
244 // pending_frame_policy() for those.
245 const blink::FramePolicy& effective_frame_policy() const {
246 return replication_state_.frame_policy;
247 }
248
249 // Set the frame_policy provided in function parameter as active frame policy,
250 // while leaving pending_frame_policy_ untouched.
251 bool CommitFramePolicy(const blink::FramePolicy& frame_policy);
252
253 const blink::mojom::FrameOwnerProperties& frame_owner_properties() {
254 return frame_owner_properties_;
255 }
256
257 void set_frame_owner_properties(
258 const blink::mojom::FrameOwnerProperties& frame_owner_properties) {
259 frame_owner_properties_ = frame_owner_properties;
260 }
261
262 const network::mojom::ContentSecurityPolicy* csp_attribute() {
263 return csp_attribute_.get();
264 }
265
266 void set_csp_attribute(
267 network::mojom::ContentSecurityPolicyPtr parsed_csp_attribute) {
268 csp_attribute_ = std::move(parsed_csp_attribute);
269 }
270
271 bool HasSameOrigin(const FrameTreeNode& node) const {
272 return replication_state_.origin.IsSameOriginWith(
273 node.replication_state_.origin);
274 }
275
276 const FrameReplicationState& current_replication_state() const {
277 return replication_state_;
278 }
279
280 RenderFrameHostImpl* current_frame_host() const {
281 return render_manager_.current_frame_host();
282 }
283
284 // Return the node immediately preceding this node in its parent's children,
285 // or nullptr if there is no such node.
286 FrameTreeNode* PreviousSibling() const;
287
288 // Return the node immediately following this node in its parent's children,
289 // or nullptr if there is no such node.
290 FrameTreeNode* NextSibling() const;
291
292 // Returns true if this node is in a loading state.
293 bool IsLoading() const;
294
Alex Moshchuk9b0fd822020-10-26 23:08:15295 // Returns true if this node has a cross-document navigation in progress.
296 bool HasPendingCrossDocumentNavigation() const;
297
danakjc492bf82020-09-09 20:02:44298 NavigationRequest* navigation_request() { return navigation_request_.get(); }
299
300 // Transfers the ownership of the NavigationRequest to |render_frame_host|.
301 // From ReadyToCommit to DidCommit, the NavigationRequest is owned by the
302 // RenderFrameHost that is committing the navigation.
303 void TransferNavigationRequestOwnership(
304 RenderFrameHostImpl* render_frame_host);
305
306 // Takes ownership of |navigation_request| and makes it the current
307 // NavigationRequest of this frame. This corresponds to the start of a new
308 // navigation. If there was an ongoing navigation request before calling this
309 // function, it is canceled. |navigation_request| should not be null.
310 void CreatedNavigationRequest(
311 std::unique_ptr<NavigationRequest> navigation_request);
312
313 // Resets the current navigation request. If |keep_state| is true, any state
314 // created by the NavigationRequest (e.g. speculative RenderFrameHost,
315 // loading state) will not be reset by the function.
316 void ResetNavigationRequest(bool keep_state);
317
318 // A RenderFrameHost in this node started loading.
319 // |to_different_document| will be true unless the load is a fragment
320 // navigation, or triggered by history.pushState/replaceState.
321 // |was_previously_loading| is false if the FrameTree was not loading before.
322 // The caller is required to provide this boolean as the delegate should only
323 // be notified if the FrameTree went from non-loading to loading state.
324 // However, when it is called, the FrameTree should be in a loading state.
325 void DidStartLoading(bool to_different_document, bool was_previously_loading);
326
327 // A RenderFrameHost in this node stopped loading.
328 void DidStopLoading();
329
330 // The load progress for a RenderFrameHost in this node was updated to
331 // |load_progress|. This will notify the FrameTree which will in turn notify
332 // the WebContents.
333 void DidChangeLoadProgress(double load_progress);
334
335 // Called when the user directed the page to stop loading. Stops all loads
336 // happening in the FrameTreeNode. This method should be used with
337 // FrameTree::ForEach to stop all loads in the entire FrameTree.
338 bool StopLoading();
339
340 // Returns the time this frame was last focused.
341 base::TimeTicks last_focus_time() const { return last_focus_time_; }
342
343 // Called when this node becomes focused. Updates the node's last focused
344 // time and notifies observers.
345 void DidFocus();
346
347 // Called when the user closed the modal dialogue for BeforeUnload and
348 // cancelled the navigation. This should stop any load happening in the
349 // FrameTreeNode.
350 void BeforeUnloadCanceled();
351
352 // Returns the BlameContext associated with this node.
353 FrameTreeNodeBlameContext& blame_context() { return blame_context_; }
354
355 // Updates the user activation state in the browser frame tree and in the
356 // frame trees in all renderer processes except the renderer for this node
357 // (which initiated the update). Returns |false| if the update tries to
358 // consume an already consumed/expired transient state, |true| otherwise. See
359 // the comment on user_activation_state_ below.
360 //
361 // The |notification_type| parameter is used for histograms, only for the case
362 // |update_state == kNotifyActivation|.
363 bool UpdateUserActivationState(
364 blink::mojom::UserActivationUpdateType update_type,
365 blink::mojom::UserActivationNotificationType notification_type);
366
367 void OnSetHadStickyUserActivationBeforeNavigation(bool value);
368
369 // Returns the sandbox flags currently in effect for this frame. This includes
370 // flags inherited from parent frames, the currently active flags from the
371 // <iframe> element hosting this frame, as well as any flags set from a
372 // Content-Security-Policy HTTP header. This does not include flags that have
373 // have been updated in an <iframe> element but have not taken effect yet; use
374 // pending_frame_policy() for those. To see the flags which will take effect
375 // on navigation (which does not include the CSP-set flags), use
376 // effective_frame_policy().
377 network::mojom::WebSandboxFlags active_sandbox_flags() const {
378 return replication_state_.active_sandbox_flags;
379 }
380
381 // Updates the active sandbox flags in this frame, in response to a
382 // Content-Security-Policy header adding additional flags, in addition to
383 // those given to this frame by its parent, or in response to the
384 // Feature-Policy header being set. Note that on navigation, these updates
385 // will be cleared, and the flags in the pending frame policy will be applied
386 // to the frame.
Alexander Timin45b716c2020-11-06 01:40:31387 // Returns true iff this operation has changed state of either sandbox flags
388 // or feature policy.
389 bool UpdateFramePolicyHeaders(
danakjc492bf82020-09-09 20:02:44390 network::mojom::WebSandboxFlags sandbox_flags,
391 const blink::ParsedFeaturePolicy& parsed_header);
392
393 // Returns whether the frame received a user gesture on a previous navigation
394 // on the same eTLD+1.
395 bool has_received_user_gesture_before_nav() const {
396 return replication_state_.has_received_user_gesture_before_nav;
397 }
398
399 // When a tab is discarded, WebContents sets was_discarded on its
400 // root FrameTreeNode.
401 // In addition, when a child frame is created, this bit is passed on from
402 // parent to child.
403 // When a navigation request is created, was_discarded is passed on to the
404 // request and reset to false in FrameTreeNode.
405 void set_was_discarded() { was_discarded_ = true; }
406 bool was_discarded() const { return was_discarded_; }
407
408 // Returns the sticky bit of the User Activation v2 state of the
409 // |FrameTreeNode|.
410 bool HasStickyUserActivation() const {
411 return user_activation_state_.HasBeenActive();
412 }
413
414 // Returns the transient bit of the User Activation v2 state of the
415 // |FrameTreeNode|.
416 bool HasTransientUserActivation() {
417 return user_activation_state_.IsActive();
418 }
419
420 // Remove history entries for all frames created by script in this frame's
421 // subtree. If a frame created by a script is removed, then its history entry
422 // will never be reused - this saves memory.
423 void PruneChildFrameNavigationEntries(NavigationEntryImpl* entry);
424
425 blink::mojom::FrameOwnerElementType frame_owner_element_type() const {
426 return replication_state_.frame_owner_element_type;
427 }
428 // Only meaningful to call on a root frame. The value of |feature_state| will
429 // be nontrivial if there is an opener which is restricted in some of the
430 // feature policies.
431 void SetOpenerFeaturePolicyState(
432 const blink::FeaturePolicyFeatureState& feature_state);
433
434 void SetAdFrameType(blink::mojom::AdFrameType ad_frame_type);
435
arthursonzogni034bb9c2020-10-01 08:29:56436 // The initial popup URL for new window opened using:
437 // `window.open(initial_popup_url)`.
438 // An empty GURL otherwise.
439 //
440 // [WARNING] There is no guarantee the FrameTreeNode will ever host a
441 // document served from this URL. The FrameTreeNode always starts hosting the
442 // initial empty document and attempts a navigation toward this URL. However
443 // the navigation might be delayed, redirected and even cancelled.
444 void SetInitialPopupURL(const GURL& initial_popup_url);
445 const GURL& initial_popup_url() const { return initial_popup_url_; }
446
447 // The origin of the document that used window.open() to create this frame.
448 // Otherwise, an opaque Origin with a nonce different from all previously
449 // existing Origins.
450 void SetPopupCreatorOrigin(const url::Origin& popup_creator_origin);
451 const url::Origin& popup_creator_origin() const {
452 return popup_creator_origin_;
453 }
454
danakjc492bf82020-09-09 20:02:44455 private:
456 FRIEND_TEST_ALL_PREFIXES(SitePerProcessFeaturePolicyBrowserTest,
457 ContainerPolicyDynamic);
458 FRIEND_TEST_ALL_PREFIXES(SitePerProcessFeaturePolicyBrowserTest,
459 ContainerPolicySandboxDynamic);
460
461 class OpenerDestroyedObserver;
462
463 FrameTreeNode* GetSibling(int relative_offset) const;
464
465 // The |notification_type| parameter is used for histograms only.
466 bool NotifyUserActivation(
467 blink::mojom::UserActivationNotificationType notification_type);
468
469 bool ConsumeTransientUserActivation();
470
471 bool ClearUserActivation();
472
473 // Verify that the renderer process is allowed to set user activation on this
474 // frame by checking whether this frame's RenderWidgetHost had previously seen
475 // an input event that might lead to user activation. If user activation
476 // should be allowed, this returns true and also clears corresponding pending
477 // user activation state in the widget. Otherwise, this returns false.
478 bool VerifyUserActivation();
479
480 // The next available browser-global FrameTreeNode ID.
481 static int next_frame_tree_node_id_;
482
483 // The FrameTree that owns us.
484 FrameTree* frame_tree_; // not owned.
485
486 // Manages creation and swapping of RenderFrameHosts for this frame.
487 RenderFrameHostManager render_manager_;
488
489 // A browser-global identifier for the frame in the page, which stays stable
490 // even if the frame does a cross-process navigation.
491 const int frame_tree_node_id_;
492
493 // The RenderFrameHost owning this FrameTreeNode, which cannot change for the
494 // life of this FrameTreeNode. |nullptr| if this node is the root.
495 RenderFrameHostImpl* const parent_;
496
497 // Number of edges from this node to the root. 0 if this is the root.
498 const unsigned int depth_;
499
500 // The frame that opened this frame, if any. Will be set to null if the
501 // opener is closed, or if this frame disowns its opener by setting its
502 // window.opener to null.
503 FrameTreeNode* opener_;
504
505 // An observer that clears this node's |opener_| if the opener is destroyed.
506 // This observer is added to the |opener_|'s observer list when the |opener_|
507 // is set to a non-null node, and it is removed from that list when |opener_|
508 // changes or when this node is destroyed. It is also cleared if |opener_|
509 // is disowned.
510 std::unique_ptr<OpenerDestroyedObserver> opener_observer_;
511
512 // The frame that opened this frame, if any. Contrary to opener_, this
513 // cannot be changed unless the original opener is destroyed.
514 FrameTreeNode* original_opener_;
515
Wolfgang Beyerd8809db2020-09-30 15:29:39516 // The devtools frame token of the frame which opened this frame. This is
517 // not cleared even if the opener is destroyed or disowns the frame.
518 base::Optional<base::UnguessableToken> opener_devtools_frame_token_;
519
danakjc492bf82020-09-09 20:02:44520 // An observer that clears this node's |original_opener_| if the opener is
521 // destroyed.
522 std::unique_ptr<OpenerDestroyedObserver> original_opener_observer_;
523
arthursonzogni034bb9c2020-10-01 08:29:56524 // When created by an opener, the URL specified in window.open(url)
525 // Please refer to {Get,Set}InitialPopupURL() documentation.
526 GURL initial_popup_url_;
527
528 // When created using window.open, the origin of the creator.
529 // Please refer to {Get,Set}PopupCreatorOrigin() documentation.
530 url::Origin popup_creator_origin_;
531
danakjc492bf82020-09-09 20:02:44532 // Whether this frame has committed any real load, replacing its initial
533 // about:blank page.
534 bool has_committed_real_load_;
535
536 // Whether the frame's owner element in the parent document is collapsed.
537 bool is_collapsed_;
538
539 // Track information that needs to be replicated to processes that have
540 // proxies for this frame.
541 FrameReplicationState replication_state_;
542
543 // Track the pending sandbox flags and container policy for this frame. When a
544 // parent frame dynamically updates 'sandbox', 'allow', 'allowfullscreen',
545 // 'allowpaymentrequest' or 'src' attributes, the updated policy for the frame
546 // is stored here, and transferred into replication_state_.frame_policy when
547 // they take effect on the next frame navigation.
548 blink::FramePolicy pending_frame_policy_;
549
550 // Whether the frame was created by javascript. This is useful to prune
551 // history entries when the frame is removed (because frames created by
552 // scripts are never recreated with the same unique name - see
553 // https://crbug.com/500260).
554 bool is_created_by_script_;
555
556 // Used for devtools instrumentation and trace-ability. The token is
557 // propagated to Blink's LocalFrame and both Blink and content/
558 // can tag calls and requests with this token in order to attribute them
559 // to the context frame.
560 // |devtools_frame_token_| is only defined by the browser process and is never
561 // sent back from the renderer in the control calls. It should be never used
562 // to look up the FrameTreeNode instance.
563 base::UnguessableToken devtools_frame_token_;
564
565 // Tracks the scrolling and margin properties for this frame. These
566 // properties affect the child renderer but are stored on its parent's
567 // frame element. When this frame's parent dynamically updates these
568 // properties, we update them here too.
569 //
570 // Note that dynamic updates only take effect on the next frame navigation.
571 blink::mojom::FrameOwnerProperties frame_owner_properties_;
572
573 // Contains the current parsed value of the 'csp' attribute of this frame.
574 network::mojom::ContentSecurityPolicyPtr csp_attribute_;
575
576 // Owns an ongoing NavigationRequest until it is ready to commit. It will then
577 // be reset and a RenderFrameHost will be responsible for the navigation.
578 std::unique_ptr<NavigationRequest> navigation_request_;
579
580 // List of objects observing this FrameTreeNode.
581 base::ObserverList<Observer>::Unchecked observers_;
582
583 base::TimeTicks last_focus_time_;
584
585 bool was_discarded_;
586
587 // The user activation state of the current frame. See |UserActivationState|
588 // for details on how this state is maintained.
589 blink::UserActivationState user_activation_state_;
590
591 // A helper for tracing the snapshots of this FrameTreeNode and attributing
592 // browser process activities to this node (when possible). It is unrelated
593 // to the core logic of FrameTreeNode.
594 FrameTreeNodeBlameContext blame_context_;
595
596 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode);
597};
598
599} // namespace content
600
601#endif // CONTENT_BROWSER_RENDERER_HOST_FRAME_TREE_NODE_H_