Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/trace_event/trace_event_argument.h" | 7 #include "base/trace_event/trace_event_argument.h" |
| 8 #include "content/renderer/render_frame_impl.h" | 8 #include "content/renderer/render_frame_impl.h" |
| 9 #include "content/renderer/top_level_blame_context.h" | 9 #include "content/renderer/top_level_blame_context.h" |
| 10 #include "third_party/WebKit/public/platform/Platform.h" | 10 #include "third_party/WebKit/public/platform/Platform.h" |
| 11 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 11 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 base::trace_event::BlameContext* GetParentBlameContext( | 16 base::trace_event::BlameContext* GetParentBlameContext( |
| 17 RenderFrameImpl* parent_frame) { | 17 RenderFrameImpl* parent_frame) { |
| 18 if (parent_frame) | 18 if (parent_frame) |
| 19 return parent_frame->frameBlameContext(); | 19 return parent_frame->frameBlameContext(); |
| 20 return blink::Platform::current()->topLevelBlameContext(); | 20 return blink::Platform::current()->topLevelBlameContext(); |
| 21 } | 21 } |
| 22 | 22 |
| 23 } // namespace | 23 } // namespace |
| 24 | 24 |
| 25 const char kFrameBlameContextCategory[] = "blink"; | 25 const char kFrameBlameContextCategory[] = "blink"; |
| 26 const char kFrameBlameContextName[] = "FrameBlameContext"; | 26 const char kFrameBlameContextName[] = "FrameBlameContext"; |
| 27 const char kFrameBlameContextType[] = "Frame"; | 27 const char kFrameBlameContextType[] = "RenderFrame"; |
| 28 const char kFrameBlameContextScope[] = "RenderFrame"; | 28 const char kFrameBlameContextScope[] = "RenderFrame"; |
| 29 | 29 |
| 30 FrameBlameContext::FrameBlameContext(RenderFrameImpl* render_frame, | 30 FrameBlameContext::FrameBlameContext(RenderFrameImpl* render_frame, |
| 31 RenderFrameImpl* parent_frame) | 31 RenderFrameImpl* parent_frame) |
| 32 : base::trace_event::BlameContext(kFrameBlameContextCategory, | 32 : base::trace_event::BlameContext(kFrameBlameContextCategory, |
| 33 kFrameBlameContextName, | 33 kFrameBlameContextName, |
| 34 kFrameBlameContextType, | 34 kFrameBlameContextType, |
| 35 kFrameBlameContextScope, | 35 kFrameBlameContextScope, |
| 36 render_frame->GetRoutingID(), | 36 render_frame->GetRoutingID(), |
|
Charlie Reis
2016/05/26 23:20:07
Unrelated: This scares me. Are BlameContexts proc
Charlie Reis
2016/05/26 23:21:52
Ha, nevermind. This is in the renderer process.
| |
| 37 GetParentBlameContext(parent_frame)) {} | 37 GetParentBlameContext(parent_frame)) {} |
| 38 | 38 |
| 39 FrameBlameContext::~FrameBlameContext() {} | 39 FrameBlameContext::~FrameBlameContext() {} |
| 40 | 40 |
| 41 } // namespace content | 41 } // namespace content |
| OLD | NEW |