forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathframe_blame_context.cc
41 lines (32 loc) · 1.55 KB
/
frame_blame_context.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/renderer/frame_blame_context.h"
#include "base/trace_event/trace_event_argument.h"
#include "content/renderer/render_frame_impl.h"
#include "content/renderer/top_level_blame_context.h"
#include "third_party/WebKit/public/platform/Platform.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
namespace content {
namespace {
base::trace_event::BlameContext* GetParentBlameContext(
RenderFrameImpl* parent_frame) {
if (parent_frame)
return parent_frame->GetFrameBlameContext();
return blink::Platform::Current()->GetTopLevelBlameContext();
}
} // namespace
const char kFrameBlameContextCategory[] = "blink";
const char kFrameBlameContextName[] = "FrameBlameContext";
const char kFrameBlameContextType[] = "RenderFrame";
const char kFrameBlameContextScope[] = "RenderFrame";
FrameBlameContext::FrameBlameContext(RenderFrameImpl* render_frame,
RenderFrameImpl* parent_frame)
: base::trace_event::BlameContext(kFrameBlameContextCategory,
kFrameBlameContextName,
kFrameBlameContextType,
kFrameBlameContextScope,
render_frame->GetRoutingID(),
GetParentBlameContext(parent_frame)) {}
FrameBlameContext::~FrameBlameContext() {}
} // namespace content