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

Side by Side Diff: content/browser/frame_host/frame_tree_node_blame_context.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
OLDNEW
(Empty)
1 // Copyright 2016 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_FRAME_HOST_FRAME_TREE_NODE_BLAME_CONTEXT_H
6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_BLAME_CONTEXT_H
7
8 #include "base/macros.h"
9 #include "base/synchronization/lock.h"
10 #include "base/trace_event/blame_context.h"
11 #include "url/gurl.h"
12
13 namespace base {
14 namespace trace_event {
15 class TracedValue;
16 }
17 }
18
19 namespace content {
20
21 class FrameTreeNode;
22
23 // FrameTreeNodeBlameContext is a helper class for tracing snapshots of each
24 // FrameTreeNode and attributing browser activities to frames (when possible),
25 // in the framework of FrameBlamer (crbug.com/546021).
26 //
27 //
28 // *** LIFECYCLE ***
29 //
30 // Each FrameTreeNodeBlameContext is owned by a FrameTreeNode, and each
31 // FrameTreeNode owns at most one FrameTreeNodeBlameContext. The lifecycle
32 // of each FrameTreeNodeBlameContext is managed by its owner node.
33 // Creation: For each root FrameTreeNode, its blame context is created right
34 // after the node's intialization. For each other node, its blame context is
35 // created after the node is attached to a parent node. If the owner node is
36 // reattached to a different parent node, its original blame context gets
37 // destroyed and replaced by a new one.
38 // Update: Whenever the owner node navigates, it calls UpdateArguments() of
39 // its blame context to update its value. The is the only way to update the
40 // value of a FrameTreeNodeBlameContext.
41 // Deletion: A FrameTreeNodeBlameContext is deleted when its owner node is
42 // deleted or reattached to a different parent node.
43
44 class FrameTreeNodeBlameContext : public base::trace_event::BlameContext {
45 public:
46 FrameTreeNodeBlameContext(FrameTreeNode* node);
47 ~FrameTreeNodeBlameContext() override;
48 void UpdateArguments();
49
50 private:
51 void AsValueInto(base::trace_event::TracedValue* value) override;
52
53 // Buffered information of the owner node, maintained by UpdateArguments().
54 int process_id_;
55 int routing_id_;
56 GURL url_;
57
58 FrameTreeNode* const owner_;
59
60 DISALLOW_COPY_AND_ASSIGN(FrameTreeNodeBlameContext);
61 };
62
63 } // content
64
65 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_BLAME_CONTEXT_H
OLDNEW
« no previous file with comments | « content/browser/frame_host/frame_tree_node.cc ('k') | content/browser/frame_host/frame_tree_node_blame_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698