Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: content/browser/frame_host/frame_tree_node.h

Issue 1901023003: Introduce browser side FrameTreeNodeBlameContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove thread safety handling (and its doc) Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/frame_host/frame_tree.cc ('k') | content/browser/frame_host/frame_tree_node.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ 5 #ifndef CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_
6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ 6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
16 #include "content/browser/frame_host/frame_tree_node_blame_context.h"
16 #include "content/browser/frame_host/render_frame_host_impl.h" 17 #include "content/browser/frame_host/render_frame_host_impl.h"
17 #include "content/browser/frame_host/render_frame_host_manager.h" 18 #include "content/browser/frame_host/render_frame_host_manager.h"
18 #include "content/common/content_export.h" 19 #include "content/common/content_export.h"
19 #include "content/common/frame_replication_state.h" 20 #include "content/common/frame_replication_state.h"
20 #include "third_party/WebKit/public/web/WebFrameOwnerProperties.h" 21 #include "third_party/WebKit/public/web/WebFrameOwnerProperties.h"
21 #include "url/gurl.h" 22 #include "url/gurl.h"
22 #include "url/origin.h" 23 #include "url/origin.h"
23 24
24 namespace content { 25 namespace content {
25 26
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 259
259 // Called when this node becomes focused. Updates the node's last focused 260 // Called when this node becomes focused. Updates the node's last focused
260 // time and notifies observers. 261 // time and notifies observers.
261 void DidFocus(); 262 void DidFocus();
262 263
263 // Called when the user closed the modal dialogue for BeforeUnload and 264 // Called when the user closed the modal dialogue for BeforeUnload and
264 // cancelled the navigation. This should stop any load happening in the 265 // cancelled the navigation. This should stop any load happening in the
265 // FrameTreeNode. 266 // FrameTreeNode.
266 void BeforeUnloadCanceled(); 267 void BeforeUnloadCanceled();
267 268
269 // Creates and initializes a new FrameTreeNodeBlameContext for tracing
270 // snapshots of this node and attributing browser process activities to it.
271 void InitializeBlameContext();
272
273 FrameTreeNodeBlameContext* blame_context() const {
274 return blame_context_.get();
275 }
276
268 private: 277 private:
269 class OpenerDestroyedObserver; 278 class OpenerDestroyedObserver;
270 279
271 void set_parent(FrameTreeNode* parent) { parent_ = parent; } 280 void set_parent(FrameTreeNode* parent) { parent_ = parent; }
272 281
273 void TraceSnapshot() const;
274
275 // The next available browser-global FrameTreeNode ID. 282 // The next available browser-global FrameTreeNode ID.
276 static int next_frame_tree_node_id_; 283 static int next_frame_tree_node_id_;
277 284
278 // The FrameTree that owns us. 285 // The FrameTree that owns us.
279 FrameTree* frame_tree_; // not owned. 286 FrameTree* frame_tree_; // not owned.
280 287
281 // The Navigator object responsible for managing navigations at this node 288 // The Navigator object responsible for managing navigations at this node
282 // of the frame tree. 289 // of the frame tree.
283 scoped_refptr<Navigator> navigator_; 290 scoped_refptr<Navigator> navigator_;
284 291
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 // PlzNavigate 347 // PlzNavigate
341 // Owns an ongoing NavigationRequest until it is ready to commit. It will then 348 // Owns an ongoing NavigationRequest until it is ready to commit. It will then
342 // be reset and a RenderFrameHost will be responsible for the navigation. 349 // be reset and a RenderFrameHost will be responsible for the navigation.
343 std::unique_ptr<NavigationRequest> navigation_request_; 350 std::unique_ptr<NavigationRequest> navigation_request_;
344 351
345 // List of objects observing this FrameTreeNode. 352 // List of objects observing this FrameTreeNode.
346 base::ObserverList<Observer> observers_; 353 base::ObserverList<Observer> observers_;
347 354
348 base::TimeTicks last_focus_time_; 355 base::TimeTicks last_focus_time_;
349 356
357 // The FrameTreeNodeBlameContext object for tracing the snapshots of this
358 // FrameTreeNode and attributing browser process activities to this node
359 // (when possible). It is unrelated to the core logic of FrameTreeNode.
360 // See frame_tree_node_blame_context.h for more detailed documentation.
361 std::unique_ptr<FrameTreeNodeBlameContext> blame_context_;
362
350 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode); 363 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode);
351 }; 364 };
352 365
353 } // namespace content 366 } // namespace content
354 367
355 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ 368 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_
OLDNEW
« no previous file with comments | « content/browser/frame_host/frame_tree.cc ('k') | content/browser/frame_host/frame_tree_node.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698