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

Unified Diff: base/trace_event/heap_profiler_stack_frame_deduplicator.cc

Issue 1907593002: Revert of [tracing] Turn StackFrame into struct. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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: base/trace_event/heap_profiler_stack_frame_deduplicator.cc
diff --git a/base/trace_event/heap_profiler_stack_frame_deduplicator.cc b/base/trace_event/heap_profiler_stack_frame_deduplicator.cc
index 22957804f137b38b44f1610e6621c698702bbbd3..12121937530ff30503e6c6dd0a5f65cc38f4bedc 100644
--- a/base/trace_event/heap_profiler_stack_frame_deduplicator.cc
+++ b/base/trace_event/heap_profiler_stack_frame_deduplicator.cc
@@ -31,7 +31,7 @@
std::map<StackFrame, int>* nodes = &roots_;
// Loop through the frames, early out when a frame is null.
- for (const StackFrame* it = beginFrame; it != endFrame; it++) {
+ for (const StackFrame* it = beginFrame; it != endFrame && *it; it++) {
StackFrame frame = *it;
auto node = nodes->find(frame);
@@ -78,19 +78,7 @@
out->append(stringify_buffer);
std::unique_ptr<TracedValue> frame_node_value(new TracedValue);
- const StackFrame& frame = frame_node->frame;
- switch (frame.type) {
- case StackFrame::Type::TRACE_EVENT_NAME:
- frame_node_value->SetString(
- "name", static_cast<const char*>(frame.value));
- break;
- case StackFrame::Type::THREAD_NAME:
- SStringPrintf(&stringify_buffer,
- "[Thread: %s]",
- static_cast<const char*>(frame.value));
- frame_node_value->SetString("name", stringify_buffer);
- break;
- }
+ frame_node_value->SetString("name", frame_node->frame);
if (frame_node->parent_frame_index >= 0) {
SStringPrintf(&stringify_buffer, "%d", frame_node->parent_frame_index);
frame_node_value->SetString("parent", stringify_buffer);

Powered by Google App Engine
This is Rietveld 408576698