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

Side by Side Diff: base/trace_event/malloc_dump_provider.cc

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 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 unified diff | Download patch
« no previous file with comments | « base/trace_event/malloc_dump_provider.h ('k') | base/trace_event/memory_allocator_dump.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/malloc_dump_provider.h" 5 #include "base/trace_event/malloc_dump_provider.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/allocator/allocator_extension.h" 9 #include "base/allocator/allocator_extension.h"
10 #include "base/allocator/allocator_shim.h" 10 #include "base/allocator/allocator_shim.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 if (allocation_register_) { 184 if (allocation_register_) {
185 if (args.level_of_detail == MemoryDumpLevelOfDetail::DETAILED) { 185 if (args.level_of_detail == MemoryDumpLevelOfDetail::DETAILED) {
186 for (const auto& alloc_size : *allocation_register_) 186 for (const auto& alloc_size : *allocation_register_)
187 bytes_by_context[alloc_size.context] += alloc_size.size; 187 bytes_by_context[alloc_size.context] += alloc_size.size;
188 } 188 }
189 allocation_register_->EstimateTraceMemoryOverhead(&overhead); 189 allocation_register_->EstimateTraceMemoryOverhead(&overhead);
190 } 190 }
191 } // lock(allocation_register_lock_) 191 } // lock(allocation_register_lock_)
192 192
193 if (!bytes_by_context.empty()) { 193 if (!bytes_by_context.empty()) {
194 scoped_ptr<TracedValue> heap_dump = ExportHeapDump( 194 std::unique_ptr<TracedValue> heap_dump = ExportHeapDump(
195 bytes_by_context, pmd->session_state()->stack_frame_deduplicator(), 195 bytes_by_context, pmd->session_state()->stack_frame_deduplicator(),
196 pmd->session_state()->type_name_deduplicator()); 196 pmd->session_state()->type_name_deduplicator());
197 pmd->AddHeapDump("malloc", std::move(heap_dump)); 197 pmd->AddHeapDump("malloc", std::move(heap_dump));
198 } 198 }
199 overhead.DumpInto("tracing/heap_profiler_malloc", pmd); 199 overhead.DumpInto("tracing/heap_profiler_malloc", pmd);
200 } 200 }
201 tid_dumping_heap_ = kInvalidThreadId; 201 tid_dumping_heap_ = kInvalidThreadId;
202 202
203 return true; 203 return true;
204 } 204 }
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 tid_dumping_heap_ == PlatformThread::CurrentId()) 252 tid_dumping_heap_ == PlatformThread::CurrentId())
253 return; 253 return;
254 AutoLock lock(allocation_register_lock_); 254 AutoLock lock(allocation_register_lock_);
255 if (!allocation_register_) 255 if (!allocation_register_)
256 return; 256 return;
257 allocation_register_->Remove(address); 257 allocation_register_->Remove(address);
258 } 258 }
259 259
260 } // namespace trace_event 260 } // namespace trace_event
261 } // namespace base 261 } // namespace base
OLDNEW
« no previous file with comments | « base/trace_event/malloc_dump_provider.h ('k') | base/trace_event/memory_allocator_dump.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698