Chromium Code Reviews| Index: content/common/discardable_shared_memory_heap.cc |
| diff --git a/content/common/discardable_shared_memory_heap.cc b/content/common/discardable_shared_memory_heap.cc |
| index 263f83b24ade3e4b2e910681d8446baa7546e4fc..0ef38c9c7454ea7d53897b89ac89da59fca948b3 100644 |
| --- a/content/common/discardable_shared_memory_heap.cc |
| +++ b/content/common/discardable_shared_memory_heap.cc |
| @@ -423,14 +423,18 @@ void DiscardableSharedMemoryHeap::OnMemoryDump( |
| ->GetTracingProcessId(); |
| base::trace_event::MemoryAllocatorDumpGuid shared_segment_guid = |
| GetSegmentGUIDForTracing(tracing_process_id, segment_id); |
| - pmd->CreateSharedGlobalAllocatorDump(shared_segment_guid); |
| + base::trace_event::MemoryAllocatorDump* global_dump = |
| + pmd->CreateSharedGlobalAllocatorDump(shared_segment_guid); |
| + |
| + // Set the dump as weak so that it is invalidated if the browser had purged |
| + // the segment. |
| + global_dump->set_flags(base::trace_event::MemoryAllocatorDump::Flags::WEAK); |
|
petrcermak
2016/01/13 17:46:14
This will work as long as there is no other user o
ssid
2016/01/15 17:14:56
Done.
|
| // The size is added to the global dump so that it gets propagated to both the |
| // dumps associated. |
| - pmd->GetSharedGlobalAllocatorDump(shared_segment_guid) |
| - ->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, |
| - base::trace_event::MemoryAllocatorDump::kUnitsBytes, |
| - allocated_objects_size_in_bytes); |
| + global_dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, |
| + base::trace_event::MemoryAllocatorDump::kUnitsBytes, |
| + allocated_objects_size_in_bytes); |
| // By creating an edge with a higher |importance| (w.r.t. browser-side dumps) |
| // the tracing UI will account the effective size of the segment to the child. |