Index: ui/gl/gl_image_shared_memory.cc |
diff --git a/ui/gl/gl_image_shared_memory.cc b/ui/gl/gl_image_shared_memory.cc |
index 83c8e5eba5388c0585072fa87a2c80f51699f499..71c8e2d4f14d7cb09ec38c23b64f6e141d6d91a7 100644 |
--- a/ui/gl/gl_image_shared_memory.cc |
+++ b/ui/gl/gl_image_shared_memory.cc |
@@ -6,6 +6,7 @@ |
#include "base/logging.h" |
#include "base/memory/shared_memory.h" |
+#include "base/memory/shared_memory_tracker.h" |
#include "base/numerics/safe_math.h" |
#include "base/process/process_handle.h" |
#include "base/sys_info.h" |
@@ -87,10 +88,14 @@ void GLImageSharedMemory::OnMemoryDump( |
base::trace_event::MemoryAllocatorDump::kUnitsBytes, |
static_cast<uint64_t>(size_in_bytes)); |
- auto guid = GetGenericSharedMemoryGUIDForTracing(process_tracing_id, |
- shared_memory_id_); |
- pmd->CreateSharedGlobalAllocatorDump(guid); |
- pmd->AddOwnershipEdge(dump->guid(), guid); |
+ if (shared_memory_) { |
+ auto guid = GetGenericSharedMemoryGUIDForTracing(process_tracing_id, |
+ shared_memory_id_); |
+ pmd->CreateSharedGlobalAllocatorDump(guid); |
+ pmd->AddOwnershipEdge(dump->guid(), guid); |
+ base::SharedMemoryTracker::AddOwnershipEdgeToSharedGlobalDump( |
+ pmd, guid, shared_memory_->handle(), shared_memory_->mapped_size()); |
+ } |
} |
} // namespace gl |