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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/V8HeapProfilerAgentImpl.cpp

Issue 2150803002: [DevTools] Add callFrame to CPUProfileNode & SamplingHeapProfileNode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 4 years, 5 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
Index: third_party/WebKit/Source/platform/v8_inspector/V8HeapProfilerAgentImpl.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8HeapProfilerAgentImpl.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8HeapProfilerAgentImpl.cpp
index 19c0a7c5b8d6ff8baed2e16cc41be4a2fe5233d0..240dc3d27492e91624fc13ae458fd62ca4e2fdab 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8HeapProfilerAgentImpl.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8HeapProfilerAgentImpl.cpp
@@ -361,12 +361,15 @@ std::unique_ptr<protocol::HeapProfiler::SamplingHeapProfileNode> buildSampingHea
size_t selfSize = 0;
for (const auto& allocation : node->allocations)
selfSize += allocation.size * allocation.count;
- std::unique_ptr<protocol::HeapProfiler::SamplingHeapProfileNode> result = protocol::HeapProfiler::SamplingHeapProfileNode::create()
+ std::unique_ptr<protocol::Runtime::CallFrame> callFrame = protocol::Runtime::CallFrame::create()
.setFunctionName(toProtocolString(node->name))
.setScriptId(String16::fromInteger(node->script_id))
.setUrl(toProtocolString(node->script_name))
- .setLineNumber(node->line_number)
- .setColumnNumber(node->column_number)
+ .setLineNumber(node->line_number - 1)
+ .setColumnNumber(node->column_number - 1)
+ .build();
+ std::unique_ptr<protocol::HeapProfiler::SamplingHeapProfileNode> result = protocol::HeapProfiler::SamplingHeapProfileNode::create()
+ .setCallFrame(std::move(callFrame))
.setSelfSize(selfSize)
.setChildren(std::move(children)).build();
return result;

Powered by Google App Engine
This is Rietveld 408576698