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

Side by Side Diff: content/renderer/frame_blame_context.cc

Issue 1864403003: Trace LayoutObject src attributes and parent frames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 #include "content/renderer/frame_blame_context.h" 5 #include "content/renderer/frame_blame_context.h"
6 6
7 #include "base/strings/stringprintf.h"
7 #include "base/trace_event/trace_event_argument.h" 8 #include "base/trace_event/trace_event_argument.h"
8 #include "content/renderer/render_frame_impl.h" 9 #include "content/renderer/render_frame_impl.h"
9 #include "content/renderer/top_level_blame_context.h" 10 #include "content/renderer/top_level_blame_context.h"
10 #include "third_party/WebKit/public/platform/Platform.h" 11 #include "third_party/WebKit/public/platform/Platform.h"
11 #include "third_party/WebKit/public/web/WebLocalFrame.h" 12 #include "third_party/WebKit/public/web/WebLocalFrame.h"
12 13
13 namespace content { 14 namespace content {
14 namespace { 15 namespace {
15 16
16 base::trace_event::BlameContext* GetParentBlameContext( 17 base::trace_event::BlameContext* GetParentBlameContext(
(...skipping 10 matching lines...) Expand all
27 const char kFrameBlameContextType[] = "Frame"; 28 const char kFrameBlameContextType[] = "Frame";
28 const char kFrameBlameContextScope[] = "RenderFrame"; 29 const char kFrameBlameContextScope[] = "RenderFrame";
29 30
30 FrameBlameContext::FrameBlameContext(RenderFrameImpl* render_frame, 31 FrameBlameContext::FrameBlameContext(RenderFrameImpl* render_frame,
31 RenderFrameImpl* parent_frame) 32 RenderFrameImpl* parent_frame)
32 : base::trace_event::BlameContext(kFrameBlameContextCategory, 33 : base::trace_event::BlameContext(kFrameBlameContextCategory,
33 kFrameBlameContextName, 34 kFrameBlameContextName,
34 kFrameBlameContextType, 35 kFrameBlameContextType,
35 kFrameBlameContextScope, 36 kFrameBlameContextScope,
36 render_frame->GetRoutingID(), 37 render_frame->GetRoutingID(),
37 GetParentBlameContext(parent_frame)) {} 38 GetParentBlameContext(parent_frame)),
39 frame_(render_frame) {
40 }
38 41
39 FrameBlameContext::~FrameBlameContext() {} 42 FrameBlameContext::~FrameBlameContext() {}
40 43
44 void FrameBlameContext::AsValueInto(base::trace_event::TracedValue* value) {
45 value->BeginDictionary("LayoutTree");
46 value->SetString("scope", "LayoutTree");
47 value->SetString("id_ref", base::StringPrintf("%p", frame_->GetWebFrame()));
48 value->EndDictionary();
49 }
50
41 } // namespace content 51 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698