Index: gpu/command_buffer/service/buffer_manager.cc |
diff --git a/gpu/command_buffer/service/buffer_manager.cc b/gpu/command_buffer/service/buffer_manager.cc |
index 4469af8f2edde71928f86ee080007303eda04c91..056f6540b0ea01c66c522dd41499a4a0c89e05fe 100644 |
--- a/gpu/command_buffer/service/buffer_manager.cc |
+++ b/gpu/command_buffer/service/buffer_manager.cc |
@@ -10,6 +10,7 @@ |
#include "base/format_macros.h" |
#include "base/logging.h" |
+#include "base/memory/shared_memory_tracker.h" |
#include "base/numerics/safe_math.h" |
#include "base/strings/stringprintf.h" |
#include "base/threading/thread_task_runner_handle.h" |
@@ -737,10 +738,18 @@ bool BufferManager::OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, |
MemoryAllocatorDump::kUnitsBytes, |
static_cast<uint64_t>(buffer->size())); |
- auto guid = gl::GetGLBufferGUIDForTracing(share_group_tracing_guid, |
- client_buffer_id); |
- pmd->CreateSharedGlobalAllocatorDump(guid); |
- pmd->AddOwnershipEdge(dump->guid(), guid); |
+ auto mapped_range = buffer->GetMappedRange(); |
+ if (!mapped_range) |
+ continue; |
+ auto shared_memory = mapped_range->shm->backing()->shared_memory(); |
+ if (shared_memory) { |
+ auto guid = gl::GetGLBufferGUIDForTracing(share_group_tracing_guid, |
+ client_buffer_id); |
+ pmd->CreateSharedGlobalAllocatorDump(guid); |
+ pmd->AddOwnershipEdge(dump->guid(), guid); |
+ base::SharedMemoryTracker::AddOwnershipEdgeToSharedGlobalDump(pmd, guid, |
+ shared_memory->handle(), shared_memory->mapped_size()); |
+ } |
} |
return true; |