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

Unified Diff: content/browser/frame_host/frame_tree_node.cc

Issue 1775953003: Reland Trace FrameTreeNode Snapshots (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/frame_host/frame_tree_node.h ('k') | content/browser/frame_host/traced_frame_tree_node.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/frame_tree_node.cc
diff --git a/content/browser/frame_host/frame_tree_node.cc b/content/browser/frame_host/frame_tree_node.cc
index f9b793fb35a6029e20962ba2b6c8b00449097fd9..3a2f122cc7b4e40aaca88404df63d924897f15d2 100644
--- a/content/browser/frame_host/frame_tree_node.cc
+++ b/content/browser/frame_host/frame_tree_node.cc
@@ -14,6 +14,7 @@
#include "content/browser/frame_host/navigation_request.h"
#include "content/browser/frame_host/navigator.h"
#include "content/browser/frame_host/render_frame_host_impl.h"
+#include "content/browser/frame_host/traced_frame_tree_node.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/common/frame_messages.h"
#include "content/common/site_isolation_policy.h"
@@ -105,6 +106,12 @@ FrameTreeNode::FrameTreeNode(
g_frame_tree_node_id_map.Get().insert(
std::make_pair(frame_tree_node_id_, this));
CHECK(result.second);
+
+ TRACE_EVENT_OBJECT_CREATED_WITH_ID(
+ "navigation", "FrameTreeNode",
+ TRACE_ID_WITH_SCOPE("FrameTreeNode", frame_tree_node_id_));
+ // Don't TraceSnapshot() until the RenderFrameHostManager is initialized and
+ // calls SetCurrentURL().
}
FrameTreeNode::~FrameTreeNode() {
@@ -116,6 +123,10 @@ FrameTreeNode::~FrameTreeNode() {
opener_->RemoveObserver(opener_observer_.get());
g_frame_tree_node_id_map.Get().erase(frame_tree_node_id_);
+
+ TRACE_EVENT_OBJECT_DELETED_WITH_ID(
+ "navigation", "FrameTreeNode",
+ TRACE_ID_WITH_SCOPE("FrameTreeNode", frame_tree_node_id_));
}
void FrameTreeNode::AddObserver(Observer* observer) {
@@ -172,6 +183,7 @@ void FrameTreeNode::RemoveChild(FrameTreeNode* child) {
void FrameTreeNode::ResetForNewProcess() {
current_frame_host()->set_last_committed_url(GURL());
+ TraceSnapshot();
// Remove child nodes from the tree, then delete them. This destruction
// operation will notify observers.
@@ -197,6 +209,7 @@ void FrameTreeNode::SetCurrentURL(const GURL& url) {
if (!has_committed_real_load_ && url != GURL(url::kAboutBlankURL))
has_committed_real_load_ = true;
current_frame_host()->set_last_committed_url(url);
+ TraceSnapshot();
}
void FrameTreeNode::SetCurrentOrigin(const url::Origin& origin) {
@@ -448,4 +461,13 @@ void FrameTreeNode::BeforeUnloadCanceled() {
}
}
+void FrameTreeNode::TraceSnapshot() const {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(
+ "navigation", "FrameTreeNode",
+ TRACE_ID_WITH_SCOPE("FrameTreeNode", frame_tree_node_id_),
+ scoped_ptr<base::trace_event::ConvertableToTraceFormat>(
+ new TracedFrameTreeNode(*this)));
+}
+
} // namespace content
« no previous file with comments | « content/browser/frame_host/frame_tree_node.h ('k') | content/browser/frame_host/traced_frame_tree_node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698