| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/trace_event/heap_profiler_allocation_context_tracker.h" | 5 #include "base/trace_event/heap_profiler_allocation_context_tracker.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 | 9 |
| 10 #include "base/atomicops.h" | 10 #include "base/atomicops.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 if (ignore_scope_depth_) { | 161 if (ignore_scope_depth_) { |
| 162 ctx.backtrace.frames[0] = StackFrame::FromTraceEventName(kTracingOverhead); | 162 ctx.backtrace.frames[0] = StackFrame::FromTraceEventName(kTracingOverhead); |
| 163 ctx.type_name = kTracingOverhead; | 163 ctx.type_name = kTracingOverhead; |
| 164 ctx.backtrace.frame_count = 1; | 164 ctx.backtrace.frame_count = 1; |
| 165 return ctx; | 165 return ctx; |
| 166 } | 166 } |
| 167 | 167 |
| 168 CaptureMode mode = static_cast<CaptureMode>( | 168 CaptureMode mode = static_cast<CaptureMode>( |
| 169 subtle::NoBarrier_Load(&capture_mode_)); | 169 subtle::NoBarrier_Load(&capture_mode_)); |
| 170 | 170 |
| 171 auto backtrace = std::begin(ctx.backtrace.frames); | 171 auto* backtrace = std::begin(ctx.backtrace.frames); |
| 172 auto backtrace_end = std::end(ctx.backtrace.frames); | 172 auto* backtrace_end = std::end(ctx.backtrace.frames); |
| 173 | 173 |
| 174 if (!thread_name_) { | 174 if (!thread_name_) { |
| 175 // Ignore the string allocation made by GetAndLeakThreadName to avoid | 175 // Ignore the string allocation made by GetAndLeakThreadName to avoid |
| 176 // reentrancy. | 176 // reentrancy. |
| 177 ignore_scope_depth_++; | 177 ignore_scope_depth_++; |
| 178 thread_name_ = GetAndLeakThreadName(); | 178 thread_name_ = GetAndLeakThreadName(); |
| 179 ANNOTATE_LEAKING_OBJECT_PTR(thread_name_); | 179 ANNOTATE_LEAKING_OBJECT_PTR(thread_name_); |
| 180 DCHECK(thread_name_); | 180 DCHECK(thread_name_); |
| 181 ignore_scope_depth_--; | 181 ignore_scope_depth_--; |
| 182 } | 182 } |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 | 237 |
| 238 // TODO(ssid): Fix crbug.com/594803 to add file name as 3rd dimension | 238 // TODO(ssid): Fix crbug.com/594803 to add file name as 3rd dimension |
| 239 // (component name) in the heap profiler and not piggy back on the type name. | 239 // (component name) in the heap profiler and not piggy back on the type name. |
| 240 ctx.type_name = task_contexts_.empty() ? nullptr : task_contexts_.back(); | 240 ctx.type_name = task_contexts_.empty() ? nullptr : task_contexts_.back(); |
| 241 | 241 |
| 242 return ctx; | 242 return ctx; |
| 243 } | 243 } |
| 244 | 244 |
| 245 } // namespace trace_event | 245 } // namespace trace_event |
| 246 } // namespace base | 246 } // namespace base |
| OLD | NEW |