| Index: base/trace_event/process_memory_dump_unittest.cc
|
| diff --git a/base/trace_event/process_memory_dump_unittest.cc b/base/trace_event/process_memory_dump_unittest.cc
|
| index 4bb6ce37f7f5eb69a347f365ef9de247c972c90f..cf87c94b1aa0c8f94256add34ec6fa8cd8025a6b 100644
|
| --- a/base/trace_event/process_memory_dump_unittest.cc
|
| +++ b/base/trace_event/process_memory_dump_unittest.cc
|
| @@ -54,7 +54,7 @@ TEST(ProcessMemoryDumpTest, Clear) {
|
| ASSERT_EQ(nullptr, pmd1->GetSharedGlobalAllocatorDump(shared_mad_guid2));
|
|
|
| // Check that calling AsValueInto() doesn't cause a crash.
|
| - scoped_refptr<TracedValue> traced_value(new TracedValue);
|
| + scoped_ptr<TracedValue> traced_value(new TracedValue);
|
| pmd1->AsValueInto(traced_value.get());
|
|
|
| // Check that the pmd can be reused and behaves as expected.
|
| @@ -72,25 +72,25 @@ TEST(ProcessMemoryDumpTest, Clear) {
|
| ASSERT_EQ(shared_mad2, pmd1->GetSharedGlobalAllocatorDump(shared_mad_guid2));
|
| ASSERT_EQ(MemoryAllocatorDump::Flags::WEAK, shared_mad2->flags());
|
|
|
| - traced_value = new TracedValue;
|
| + traced_value.reset(new TracedValue);
|
| pmd1->AsValueInto(traced_value.get());
|
|
|
| pmd1.reset();
|
| }
|
|
|
| TEST(ProcessMemoryDumpTest, TakeAllDumpsFrom) {
|
| - scoped_refptr<TracedValue> traced_value(new TracedValue);
|
| + scoped_ptr<TracedValue> traced_value(new TracedValue);
|
| TracedValue* heap_dumps_ptr[4];
|
| - scoped_refptr<TracedValue> heap_dump;
|
| + scoped_ptr<TracedValue> heap_dump;
|
|
|
| scoped_ptr<ProcessMemoryDump> pmd1(new ProcessMemoryDump(nullptr));
|
| auto mad1_1 = pmd1->CreateAllocatorDump("pmd1/mad1");
|
| auto mad1_2 = pmd1->CreateAllocatorDump("pmd1/mad2");
|
| pmd1->AddOwnershipEdge(mad1_1->guid(), mad1_2->guid());
|
| - heap_dump = new TracedValue;
|
| + heap_dump.reset(new TracedValue);
|
| heap_dumps_ptr[0] = heap_dump.get();
|
| pmd1->AddHeapDump("pmd1/heap_dump1", std::move(heap_dump));
|
| - heap_dump = new TracedValue;
|
| + heap_dump.reset(new TracedValue);
|
| heap_dumps_ptr[1] = heap_dump.get();
|
| pmd1->AddHeapDump("pmd1/heap_dump2", std::move(heap_dump));
|
|
|
| @@ -98,10 +98,10 @@ TEST(ProcessMemoryDumpTest, TakeAllDumpsFrom) {
|
| auto mad2_1 = pmd2->CreateAllocatorDump("pmd2/mad1");
|
| auto mad2_2 = pmd2->CreateAllocatorDump("pmd2/mad2");
|
| pmd2->AddOwnershipEdge(mad2_1->guid(), mad2_2->guid());
|
| - heap_dump = new TracedValue;
|
| + heap_dump.reset(new TracedValue);
|
| heap_dumps_ptr[2] = heap_dump.get();
|
| pmd2->AddHeapDump("pmd2/heap_dump1", std::move(heap_dump));
|
| - heap_dump = new TracedValue;
|
| + heap_dump.reset(new TracedValue);
|
| heap_dumps_ptr[3] = heap_dump.get();
|
| pmd2->AddHeapDump("pmd2/heap_dump2", std::move(heap_dump));
|
|
|
| @@ -147,7 +147,7 @@ TEST(ProcessMemoryDumpTest, TakeAllDumpsFrom) {
|
| ASSERT_EQ(heap_dumps_ptr[3], GetHeapDump(*pmd1, "pmd2/heap_dump2"));
|
|
|
| // Check that calling AsValueInto() doesn't cause a crash.
|
| - traced_value = new TracedValue;
|
| + traced_value.reset(new TracedValue);
|
| pmd1->AsValueInto(traced_value.get());
|
|
|
| pmd1.reset();
|
| @@ -191,7 +191,7 @@ TEST(ProcessMemoryDumpTest, Suballocations) {
|
| ASSERT_TRUE(found_edge[1]);
|
|
|
| // Check that calling AsValueInto() doesn't cause a crash.
|
| - scoped_refptr<TracedValue> traced_value(new TracedValue);
|
| + scoped_ptr<TracedValue> traced_value(new TracedValue);
|
| pmd->AsValueInto(traced_value.get());
|
|
|
| pmd.reset();
|
|
|