Index: base/trace_event/process_memory_dump.cc |
diff --git a/base/trace_event/process_memory_dump.cc b/base/trace_event/process_memory_dump.cc |
index 1642e5a341bef3bb717500b2ead1698cc45380d8..56fda8088b8b56a09015dadbea06872ac791326c 100644 |
--- a/base/trace_event/process_memory_dump.cc |
+++ b/base/trace_event/process_memory_dump.cc |
@@ -5,8 +5,10 @@ |
#include "base/trace_event/process_memory_dump.h" |
#include <errno.h> |
+ |
#include <vector> |
+#include "base/memory/ptr_util.h" |
#include "base/process/process_metrics.h" |
#include "base/trace_event/process_memory_totals.h" |
#include "base/trace_event/trace_event_argument.h" |
@@ -82,12 +84,12 @@ size_t ProcessMemoryDump::CountResidentBytes(void* start_address, |
size_t max_vec_size = |
GetSystemPageCount(std::min(mapped_size, kMaxChunkSize), page_size); |
#if defined(OS_MACOSX) || defined(OS_IOS) |
- scoped_ptr<char[]> vec(new char[max_vec_size]); |
+ std::unique_ptr<char[]> vec(new char[max_vec_size]); |
#elif defined(OS_WIN) |
- scoped_ptr<PSAPI_WORKING_SET_EX_INFORMATION[]> vec( |
+ std::unique_ptr<PSAPI_WORKING_SET_EX_INFORMATION[]> vec( |
new PSAPI_WORKING_SET_EX_INFORMATION[max_vec_size]); |
#elif defined(OS_POSIX) |
- scoped_ptr<unsigned char[]> vec(new unsigned char[max_vec_size]); |
+ std::unique_ptr<unsigned char[]> vec(new unsigned char[max_vec_size]); |
#endif |
while (offset < mapped_size) { |
@@ -154,18 +156,18 @@ ProcessMemoryDump::~ProcessMemoryDump() {} |
MemoryAllocatorDump* ProcessMemoryDump::CreateAllocatorDump( |
const std::string& absolute_name) { |
return AddAllocatorDumpInternal( |
- make_scoped_ptr(new MemoryAllocatorDump(absolute_name, this))); |
+ WrapUnique(new MemoryAllocatorDump(absolute_name, this))); |
} |
MemoryAllocatorDump* ProcessMemoryDump::CreateAllocatorDump( |
const std::string& absolute_name, |
const MemoryAllocatorDumpGuid& guid) { |
return AddAllocatorDumpInternal( |
- make_scoped_ptr(new MemoryAllocatorDump(absolute_name, this, guid))); |
+ WrapUnique(new MemoryAllocatorDump(absolute_name, this, guid))); |
} |
MemoryAllocatorDump* ProcessMemoryDump::AddAllocatorDumpInternal( |
- scoped_ptr<MemoryAllocatorDump> mad) { |
+ std::unique_ptr<MemoryAllocatorDump> mad) { |
auto insertion_result = allocator_dumps_.insert( |
std::make_pair(mad->absolute_name(), std::move(mad))); |
DCHECK(insertion_result.second) << "Duplicate name: " << mad->absolute_name(); |
@@ -214,7 +216,7 @@ MemoryAllocatorDump* ProcessMemoryDump::GetSharedGlobalAllocatorDump( |
} |
void ProcessMemoryDump::AddHeapDump(const std::string& absolute_name, |
- scoped_ptr<TracedValue> heap_dump) { |
+ std::unique_ptr<TracedValue> heap_dump) { |
DCHECK_EQ(0ul, heap_dumps_.count(absolute_name)); |
heap_dumps_[absolute_name] = std::move(heap_dump); |
} |